Files
frontend-svelte/Dockerfile
Ilia Mashkov a8858f6199
Some checks failed
Workflow / build (push) Successful in 1m0s
Workflow / publish (push) Failing after 27s
fix: update dockerfile with corepack so we can use yarn v4
2026-02-09 14:21:33 +03:00

25 lines
662 B
Docker

# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Enable Corepack so we can use Yarn v4
RUN corepack enable && corepack prepare yarn@stable --activate
COPY package.json yarn.lock ./
RUN yarn install --immutable
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"]