Files
papercrate/frontend/Dockerfile
T
nils be451bda1e
ci / docker (backend, backend/Dockerfile, backend) (push) Failing after 14s
ci / docker (frontend, frontend/Dockerfile, frontend) (push) Failing after 13s
dev: switch to fully containerized Docker Compose workflow
- Replace tmux setup with a full Docker Compose development stack
- Update backend Dockerfile to use `cargo-chef` caching and `supervisord`
- Containerize frontend development server
- Update tests to run in isolated containers
- Remove legacy `papercrate.tmux`
2025-12-17 19:55:47 +01:00

44 lines
1.3 KiB
Docker

# syntax=docker/dockerfile:1.6
ARG NODE_IMAGE=node:20-alpine
ARG NGINX_IMAGE=nginx:alpine
# ------------------------------------------------------------------------------
# Base Stage: Install Dependencies
# ------------------------------------------------------------------------------
FROM --platform=$BUILDPLATFORM ${NODE_IMAGE} AS base
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
# ------------------------------------------------------------------------------
# Development Stage
# ------------------------------------------------------------------------------
FROM base AS development
EXPOSE 5173
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
# ------------------------------------------------------------------------------
# Build Stage
# ------------------------------------------------------------------------------
FROM base AS build
COPY . .
RUN npm run build
# ------------------------------------------------------------------------------
# Runtime Stage
# ------------------------------------------------------------------------------
FROM ${NGINX_IMAGE} AS runtime
WORKDIR /usr/share/nginx/html
COPY --from=build /app/dist ./
ENV API_PROXY_PASS=""
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
EXPOSE 80
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]