-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (21 loc) · 752 Bytes
/
Dockerfile
File metadata and controls
31 lines (21 loc) · 752 Bytes
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
FROM node
WORKDIR /nodebuild
ADD frontend /nodebuild
# Set environment variables from .env during node build
# so that the app uses the production location for static files
ADD .env /nodebuild
RUN export $(grep -v '^#' .env | xargs) && npm install && npm run build
FROM tiangolo/uwsgi-nginx
EXPOSE 8000
# Indicate where uwsgi.ini lives
ENV UWSGI_INI uwsgi.ini
WORKDIR /app
# Using pip:
COPY requirements.txt /app
RUN python3 -m pip install -r requirements.txt
ADD . /app
COPY --from=0 /nodebuild/build /app/frontend/build
# Set environment variables from .env during collect static
# so that the app uses the production location for static files
RUN export $(grep -v '^#' .env | xargs) && python3 manage.py collectstatic --noinput
RUN rm .env