-
Notifications
You must be signed in to change notification settings - Fork 58
/
Dockerfile
59 lines (44 loc) · 1.12 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
56
57
58
59
FROM python:3.10-slim-bullseye as app
RUN apt-get update \
&& apt-get install -y \
ca-certificates \
gcc \
git \
gosu \
libev4 \
libev-dev \
libevent-dev \
libxml2-dev \
libxslt1-dev \
libffi-dev \
# psycopg2
python-dev \
libpq-dev \
zlib1g-dev \
&& apt-get clean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
RUN update-ca-certificates
RUN mkdir -p /code
WORKDIR /code
RUN pip install -U pip
RUN pip install uwsgi==2.0.21
COPY ./requirements.txt /code/requirements.txt
COPY ./constraints.txt /code/constraints.txt
RUN pip install --no-cache-dir -c /code/constraints.txt -r /code/requirements.txt
RUN apt-get remove -y \
gcc \
zlib1g-dev
COPY ./ /code/
RUN python manage.py collectstatic --noinput
ARG GIT_TAG=
ARG GIT_COMMIT=
ENV VERSION ${GIT_TAG}
ENV GIT_COMMIT ${GIT_COMMIT}
RUN python setup.py develop
CMD ["python", "manage.py", "--help"]
### Dist
FROM app AS dist
### Dev
FROM app AS dev
RUN pip install --no-cache-dir -c /code/constraints.txt -r /code/dev-requirements.txt