-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
44 lines (28 loc) · 920 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
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM node:12 AS build-stage
WORKDIR /react-app
COPY react-app/. .
# You have to set this because it should be set during build time.
ENV REACT_APP_BASE_URL=https://aa-cadence.herokuapp.com
# You have to set this because it should be set during build time. s/b heroku url not postgres
# needs to be there at the time npm build runs
# the REACT_APP_GOOGLE_KEY can be found in the browser so may be unavoidable
#
# marys heroku account
# ENV REACT_APP_BASE_URL=https://cadence-appacademy-group-proj.herokuapp.com
# Build our React App
RUN npm install
RUN npm run build
FROM python:3.8
# Setup Flask environment
ENV FLASK_APP=app
ENV FLASK_ENV=production
ENV SQLALCHEMY_ECHO=True
EXPOSE 8000
WORKDIR /var/www
COPY . .
COPY --from=build-stage /react-app/build/* app/static/
# Install Python Dependencies
RUN pip install -r requirements.txt
RUN pip install psycopg2
# Run flask environment
CMD gunicorn app:app