Files
frontend-svelte/Dockerfile
Ilia Mashkov f3e9777267
All checks were successful
Workflow / build (push) Successful in 58s
feat: switch to caddy
2026-02-09 11:37:47 +03:00

23 lines
565 B
Docker

# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY . .
RUN yarn build
# Production stage - Caddy
FROM caddy:2-alpine
WORKDIR /usr/share/caddy
# Copy built static files from the builder stage
COPY --from=builder /app/dist .
# Expose the port Caddy will listen on
EXPOSE 3000
# Start Caddy as a file server with SPA support
# It serves files from the current dir and redirects unknown paths to index.html
CMD ["caddy", "file-server", "--listen", ":3000", "--try-files", "index.html"]