-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (43 loc) · 1.1 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Build
FROM python:3.11-alpine AS builder
RUN apk add --no-cache \
gcc \
musl-dev \
libffi-dev \
python3-dev \
build-base \
curl
RUN pip install --upgrade pip && pip install poetry==1.8.3
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache
WORKDIR /app
COPY pyproject.toml poetry.lock /app/
RUN poetry install --without dev --no-root && rm -rf $POETRY_CACHE_DIR
# Run
FROM python:3.11-alpine
LABEL name="Teemo" \
description="Hop, Two Three Four!" \
url="https://github.com/ipromknight/teemo"
ENV PYTHONUNBUFFERED=1
RUN apk add --no-cache \
curl \
shadow \
unzip \
gcc \
musl-dev \
libffi-dev \
python3-dev \
libpq-dev
RUN pip install poetry==1.8.3
ENV FORCE_COLOR=1
ENV TERM=xterm-256color
WORKDIR /app
COPY --from=builder /app/.venv /app/.venv
ENV VIRTUAL_ENV=/app/.venv
ENV PATH="/app/.venv/bin:$PATH"
COPY teemo/ /app/teemo
COPY pyproject.toml poetry.lock VERSION entrypoint.sh /app/
RUN chmod +x /app/entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"]