bstein-dev-home/Dockerfile.frontend

24 lines
585 B
Docker
Raw Permalink Normal View History

2025-12-18 01:13:04 -03:00
# Build stage
FROM registry.bstein.dev/bstein/node:20-bookworm AS build
2025-12-18 01:13:04 -03:00
WORKDIR /app
COPY frontend/package*.json ./
RUN npm ci --ignore-scripts
COPY frontend/ ./
COPY media/ ./public/media/
2025-12-18 01:13:04 -03:00
RUN npm run build
# Runtime stage
FROM nginx:1.27-alpine
2025-12-18 01:13:04 -03:00
WORKDIR /usr/share/nginx/html
# Minimal nginx config with SPA fallback.
COPY frontend/nginx.conf /etc/nginx/conf.d/default.conf
COPY --chown=nginx:nginx --from=build /app/dist ./
RUN chown -R nginx:nginx /etc/nginx/conf.d /usr/share/nginx/html /var/cache/nginx /run /var/run
2025-12-18 01:13:04 -03:00
EXPOSE 8080
USER nginx
2025-12-18 01:13:04 -03:00
CMD ["nginx", "-g", "daemon off;"]