-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (23 loc) · 860 Bytes
/
Dockerfile
File metadata and controls
36 lines (23 loc) · 860 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
ARG NODE_VERSION=24.7.0-alpine
ARG NGINX_VERSION=alpine3.22
# Use a lightweight Node.js image for building (customizable via ARG)
FROM node:${NODE_VERSION} AS builder
WORKDIR /app
# Copy package-related files first to leverage Docker's caching mechanism
COPY dearborn-UI/package.json dearborn-UI/package-lock.json ./
RUN npm ci
COPY dearborn-UI/ .
# Build the Angular application
RUN npm run build
FROM python:3.9-slim-buster AS runner
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY blueQ-backend.py .
# Copy the static build output from the build stage to flask's default HTML serving directory
COPY --from=builder /app/dist/*/browser ./static
EXPOSE 5000
# Define environment variables
ENV FLASK_APP=blueQ-backend.py
# Run the Flask application
CMD ["flask", "run", "--host=0.0.0.0", "--port=5000"]