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
|
2026-10-05 22:55:46 +02:00
|
|
|
# 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
|
2026-10-05 22:55:46 +02:00
|
|
|
ENTRYPOINT ["/usr/local/bin/go-guess-frontend-entrypoint"]
|
2026-09-19 20:31:14 +02:00
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|