-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.combined
More file actions
36 lines (24 loc) · 992 Bytes
/
Dockerfile.combined
File metadata and controls
36 lines (24 loc) · 992 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
32
33
34
35
36
# 1) Build the React FRONTEND
FROM node:16-alpine as build-step-frontend
WORKDIR /catalyst/frontend
# Copy package.json and package-lock.json
COPY frontend/package.json frontend/package-lock.json ./
RUN npm install
# Copy the rest of the frontend files
COPY frontend .
RUN npm run build
# 2) Build the Flask BACKEND
FROM python:3.9 as build-step-backend
WORKDIR /catalyst/backend
COPY backend .
COPY .env .
RUN pip install -r ./requirements.txt
# Set the FLASK_APP environment variable to your app.py file
ENV FLASK_APP app.py
ENV FLASK_ENV production
EXPOSE 8080
# Copy the frontend build output into the Flask static directory
COPY --from=build-step-frontend /catalyst/frontend/.next /catalyst/backend/static
# TODO the problem is that the frontend needs to be served with nginx and I could not get it to work
# Right now the frontend is served by the Flask backend and we would have to create endpoints in app.py for it...
CMD ["flask", "run", "--host=0.0.0.0", "--port=8080"]