-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (23 loc) · 802 Bytes
/
Dockerfile
File metadata and controls
28 lines (23 loc) · 802 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
# Stage 1: Build the Svelte app
FROM node:20-alpine AS svelte-build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY ./src ./src
COPY ./static ./static
COPY svelte.config.js vite.config.ts ./
RUN npm run build
# Stage 2: Set up the Python backend
FROM python:3.12-slim AS python-backend
WORKDIR /app
COPY ./kenyare/requirements.txt ./
RUN pip install -r requirements.txt
COPY ./kenyare ./kenyare
# Copy the built Svelte app to the Python backend container
COPY --from=svelte-build /app/dist /app/static
# Expose ports for both the Svelte frontend and the Python backend
EXPOSE 3000 8000
# Command to run both the Svelte frontend and the Python backend
CMD ["sh", "-c", "npm run preview & python -m kenyare.server"]
# Add a label for the image
LABEL name="kenyare-multi-stage" version="1.0"