-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.prod
38 lines (24 loc) · 885 Bytes
/
Dockerfile.prod
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
FROM python:3.7
RUN apt-get -y install curl \
&& curl -sL https://deb.nodesource.com/setup_12.x | bash \
&& apt-get install nodejs \
&& curl -o- -L https://yarnpkg.com/install.sh | bash
WORKDIR /app/backend
COPY ./backend/requirements.txt /app/backend/
RUN pip3 install --upgrade pip -r requirements.txt
WORKDIR /app/frontend
COPY ./frontend/package.json ./frontend/yarn.lock /app/frontend/
RUN $HOME/.yarn/bin/yarn install
COPY . /app/
COPY ./backend/scripts/ /app/
RUN $HOME/.yarn/bin/yarn build
WORKDIR /app/frontend/build
RUN mkdir root && mv *.js *.json root
RUN mkdir /app/backend/staticfiles
WORKDIR /app
RUN DJANGO_SETTINGS_MODULE=leia_backend.settings.production \
SECRET_KEY=SECRETKEYHERE \
python3 backend/manage.py collectstatic --noinput
EXPOSE $PORT
RUN ["chmod", "+x", "/app/entrypoint-production.sh"]
ENTRYPOINT ["/app/entrypoint-production.sh"]