Files
frontend-svelte/Dockerfile

28 lines
687 B
Docker
Raw Normal View History

2026-02-09 10:17:48 +03:00
# 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
# Force Yarn to use node_modules instead of PnP
ENV YARN_NODE_LINKER=node-modules
2026-02-09 10:17:48 +03:00
COPY package.json yarn.lock ./
RUN yarn install --immutable
2026-02-09 10:17:48 +03:00
COPY . .
RUN yarn build
2026-02-09 11:37:47 +03:00
# Production stage - Caddy
FROM caddy:2-alpine
2026-02-09 10:17:48 +03:00
2026-02-09 11:37:47 +03:00
WORKDIR /usr/share/caddy
2026-02-09 10:17:48 +03:00
2026-02-09 11:37:47 +03:00
# Copy built static files from the builder stage
COPY --from=builder /app/dist .
2026-02-09 15:22:57 +03:00
# Copy our local Caddyfile config
COPY Caddyfile /etc/caddy/Caddyfile
EXPOSE 3000
2026-02-09 15:22:57 +03:00
# Start caddy using the config file
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]