-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (22 loc) · 791 Bytes
/
Dockerfile
File metadata and controls
29 lines (22 loc) · 791 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
# Stage 1: Build the Svelte frontend
FROM node:22-alpine AS builder
WORKDIR /build
COPY package.json package-lock.json ./
RUN npm ci --legacy-peer-deps
COPY . .
RUN npm run build
# Stage 2: Final image — nginx serves static files, Node runs WS relay
FROM nginx:alpine
RUN apk add --no-cache nodejs
COPY --from=builder /build/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
WORKDIR /app/server
COPY server/package.json server/package-lock.json ./
RUN apk add --no-cache npm && npm ci --omit=dev && apk del npm
COPY server/index.js ./
COPY docker-start.sh /docker-start.sh
RUN chmod +x /docker-start.sh
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget -qO /dev/null http://localhost:80/ || exit 1
CMD ["/docker-start.sh"]