-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (23 loc) · 885 Bytes
/
Copy pathDockerfile
File metadata and controls
31 lines (23 loc) · 885 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 nikolaik/python-nodejs:python3.8-nodejs14 as base
WORKDIR /var/www
COPY . .
# Install Python Dependencies
RUN ["pip", "install", "-r", "requirements.txt"]
RUN ["pip", "install", "psycopg2"]
# Build our React App
RUN ["npm", "install", "--prefix", "client"]
RUN ["npm", "run", "build", "--prefix", "client"]
# Move our react build for Flask to serve
# Use cp here because we're copying files inside our working directory, not from
# our host machine.
RUN ["cp", "-r", "client/build", "starter_app/static"]
RUN ["cp", "-r", "starter_app/static/static/js", "starter_app/static"]
RUN ["cp", "-r", "starter_app/static/static/css", "starter_app/static"]
# Setup Flask environment
ENV FLASK_APP=starter_app
ENV FLASK_ENV=production
ENV SQLALCHEMY_ECHO=True
ENV REACT_APP_BASE_URL=https://foodie0520.herokuapp.com/
EXPOSE 8000
# Run flask environment
CMD gunicorn starter_app:app