Files
frontend-svelte/Dockerfile
Ilia Mashkov c4abe84b0a
All checks were successful
Workflow / build (push) Successful in 55s
feat: add env variable to Dockerfile
2026-02-09 10:52:37 +03:00

34 lines
540 B
Docker

# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY package.json yarn.lock ./
# Install dependencies
RUN yarn install --frozen-lockfile
# Copy source code
COPY . .
# Build the app
RUN yarn build
# Production stage - tiny Python server
FROM python:3.11-alpine
WORKDIR /app
# Copy built static files
COPY --from=builder /app/dist ./dist
# Expose port
EXPOSE 3000
# Set environment variable
ENV PYTHONUNBUFFERED=1
# Start the server
CMD ["python", "-m", "http.server", "3000", "--directory", "dist"]