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 EXPOSE 80 ENTRYPOINT ["/usr/local/bin/go-guess-frontend-entrypoint"] CMD ["nginx", "-g", "daemon off;"]