-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (23 loc) · 939 Bytes
/
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
FROM nikolaik/python-nodejs:python3.8-nodejs14 as base
WORKDIR /var/www
COPY . .
# Install Python Dependencies
RUN ["pip", "install", "-r", "requirements.txt"]
# Build our React App
RUN ["npm", "install", "--prefix", "client"]
ENV REACT_APP_BASE_URL=https://life-box.herokuapp.com
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/", "backend/static"]
# RUN ["cp", "backend/static/favicon.ico", "backend/static/static"]
# RUN ["cp", "backend/static/glider.svg", "backend/static/static"]
# Setup Flask environment
ENV FLASK_APP=backend
ENV FLASK_ENV=production
ENV SQLALCHEMY_ECHO=True
ENV SECRET_KEY=lkasjdf09ajsdkfljalsiorj12n3490re9485309irefvn,u90818734902139489230
EXPOSE 8000
# Run flask environment
CMD newrelic-admin run-program gunicorn backend:app