captains-log/frontend/Dockerfile
Drew Galbraith 69f4a6f1ca
All checks were successful
Check / Backend (push) Successful in 6m3s
Check / Frontend (push) Successful in 1m56s
Docker Build / Build and Push Backend Image (push) Successful in 12m36s
Docker Build / Build and Push Frontend Image (push) Successful in 5m22s
Set frontend API URL at build time. (#18)
Reviewed-on: #18
Co-authored-by: Drew Galbraith <drew@tiramisu.one>
Co-committed-by: Drew Galbraith <drew@tiramisu.one>
2025-10-21 04:08:53 +00:00

23 lines
644 B
Docker

FROM node:20-alpine AS development-dependencies-env
COPY . /app
WORKDIR /app
RUN npm ci
FROM node:20-alpine AS production-dependencies-env
COPY ./package.json package-lock.json /app/
WORKDIR /app
RUN npm ci --omit=dev
FROM node:20-alpine AS build-env
COPY . /app/
COPY --from=development-dependencies-env /app/node_modules /app/node_modules
WORKDIR /app
ENV VITE_API_URL=https://tasks.tiramisu.one
RUN npm run build
FROM node:20-alpine
COPY ./package.json package-lock.json /app/
COPY --from=production-dependencies-env /app/node_modules /app/node_modules
COPY --from=build-env /app/build /app/build
WORKDIR /app
CMD ["npm", "run", "start"]