go-guess/frontend/Dockerfile

19 lines
697 B
Text
Raw Permalink Normal View History

2026-09-19 20:31:14 +02:00
FROM node:26-alpine AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM nginx:1.29-alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html
# Writes runtime-config.js from the environment on start, so one image serves
# every environment instead of baking a hostname into the bundle at build time.
# It lives beside this Dockerfile because the build context is ./frontend.
COPY entrypoint.sh /usr/local/bin/go-guess-frontend-entrypoint
RUN chmod +x /usr/local/bin/go-guess-frontend-entrypoint
2026-09-19 20:31:14 +02:00
EXPOSE 80
ENTRYPOINT ["/usr/local/bin/go-guess-frontend-entrypoint"]
2026-09-19 20:31:14 +02:00
CMD ["nginx", "-g", "daemon off;"]