forked from pycontw/pycon.tw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev.Dockerfile
41 lines (31 loc) · 1.01 KB
/
dev.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
# [Node Stage to get node_modolues and node dependencies]
FROM node:8.16.0-buster-slim as node_stage
COPY ./yarn.lock yarn.lock
COPY ./package.json package.json
RUN apt-get update
RUN apt-get install python-pip -y
RUN npm install -g yarn
RUN yarn install --dev --frozen-lockfile
# [Python Stage for Django web server]
FROM python:3.6-slim-buster as python_stage
WORKDIR /app
COPY --from=node_stage /node_modules ./node_modules
COPY --from=node_stage /usr/local/bin/node /usr/local/bin/node
ENV PYTHONUNBUFFERED 1
ENV BASE_DIR /usr/local
# Infrastructure tools
# gettext is used for django to compile .po to .mo files.
RUN apt-get update
RUN apt-get install -y \
libpq-dev \
gcc \
zlib1g-dev \
libjpeg62-turbo-dev \
gettext
# Only copy and install requirements to improve caching between builds
# Install Python dependencies
COPY ./requirements ./requirements
RUN pip3 install -r ./requirements/dev.txt
# for entry point
COPY ./docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh