-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile.dev
61 lines (44 loc) · 1.38 KB
/
Dockerfile.dev
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
56
57
58
59
60
61
FROM python:3.12-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -q -y --no-install-recommends \
apt-utils \
ca-certificates \
git \
locales \
unattended-upgrades && \
unattended-upgrade -v && \
locale-gen en_GB en_GB.UTF-8 && \
localedef -i en_GB -c -f UTF-8 -A /usr/share/locale/locale.alias en_GB.UTF-8 && \
apt-get remove -q -y unattended-upgrades && \
apt-get autoremove -q -y && \
apt-get clean -q -y && \
rm -rf /var/lib/apt/lists/*
ENV LANG=en_GB.UTF-8 \
LANGUAGE=en_GB \
LC_ALL=en_GB.UTF-8 \
TZ=/Etc/UTC
WORKDIR /app
ARG APP_USER=appuser
ARG APP_UID=1000
ARG APP_GID=$APP_UID
RUN groupadd --gid $APP_GID $APP_USER && \
useradd --uid $APP_UID --gid $APP_GID --shell /bin/bash --create-home $APP_USER
ARG POETRY_VERSION="1.8.3"
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_CACHE_DIR=/app/.poetry
RUN python -m venv /app/venv && \
. /app/venv/bin/activate && \
pip install --no-cache-dir "poetry==$POETRY_VERSION"
COPY pyproject.toml poetry.lock /app/
RUN . /app/venv/bin/activate && \
poetry install --no-root
COPY . /app
RUN . /app/venv/bin/activate && \
poetry install && \
rm -rf "$POETRY_CACHE_DIR"
RUN chown -R $APP_USER:$APP_USER /app
USER $APP_USER
ENTRYPOINT ["/app/docker/entrypoint.sh"]
CMD ["/bin/bash", "-c", "sleep infinity"]