-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
34 lines (26 loc) · 890 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
# Step 1: Build the React app
FROM node:22 AS react-build
WORKDIR /app/react
COPY resume-builder-ui/package*.json ./
RUN npm install
COPY resume-builder-ui/ ./
RUN npm run build
# Step 2: Set up the Python (Flask) environment
FROM python:3.11-slim-bullseye AS flask
WORKDIR /app
# Install wkhtmltopdf and other dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
wkhtmltopdf \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Step 3: Copy the Flask app
COPY . .
# Remove React code
RUN rm -rf /app/resume-builder-ui
# Copy React build output to Flask's static folder
COPY --from=react-build /app/react/dist/ /app/static/
# Expose the port that Cloud Run requires
EXPOSE 5000
# Command to run the app with gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"]