-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
60 lines (43 loc) · 1.28 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
60
FROM python:3.8-slim-buster as image_base
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONDEBUG 1
RUN apt-get update \
# dependencies for building Python packages
&& apt-get install -y build-essential \
# psycopg2 dependencies
&& apt-get install -y libpq-dev \
# Translations dependencies
&& apt-get install -y gettext bash \
# cleaning up unused files
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip
COPY ./requirements /requirements
RUN pip install --no-cache-dir -r /requirements/common.txt
COPY ./requirements /requirements
RUN pip install --no-cache-dir -r /requirements/common.txt
COPY compose/post-build /post-build
RUN sed -i 's/\r//' /post-build
RUN chmod +x /post-build
EXPOSE 8000
WORKDIR /app
#
# D E V E L O P M E N T
#
FROM image_base as development
RUN pip install -r /requirements/testing.txt
RUN pip install -r /requirements/develop.txt
COPY compose/entrypoint /entrypoint
RUN sed -i 's/\r//' /entrypoint
RUN chmod +x /entrypoint
COPY compose/start-dev /start
RUN sed -i 's/\r//' /start
RUN chmod +x /start
ENTRYPOINT ["/entrypoint"]
#
# C I / C D
#
FROM development as ci_cd
RUN apk add make build-base
RUN pip install docker-compose awscli