-
-
Notifications
You must be signed in to change notification settings - Fork 181
/
Dockerfile
41 lines (33 loc) · 1017 Bytes
/
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
FROM python:3.9-slim
LABEL maintainer="[email protected]"
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONIOENCODING=utf-8 \
LANG=C.UTF-8
RUN apt-get -qq update \
&& apt-get -y install \
bash \
locales \
git \
build-essential \
libssl-dev \
&& pip install poetry \
&& rm -rf /var/lib/apt/lists/* \
&& ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime \
&& locale-gen C.UTF-8 || true
ARG USER_ID
ARG GROUP_ID
RUN addgroup --gid $GROUP_ID user || true \
&& useradd -M -u $USER_ID -g $GROUP_ID user || true \
&& usermod -d /code user || true
RUN mkdir -p /code
WORKDIR /code
COPY ./example_site/pyproject.toml ./example_site/poetry.lock /code/
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi
COPY ./example_site /code/
COPY ./address /code/address
RUN chown -R user:user /code
USER user
EXPOSE 8000
CMD ./manage.py migrate && ./manage.py runserver 0.0.0.0:8000