Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile Update: Build and Serve GoFr Website as Static Site Using GoFr static-server #1246

Open
wants to merge 10 commits into
base: development
Choose a base branch
from
18 changes: 10 additions & 8 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/gofr-dev/website:latest
FROM ghcr.io/gofr-dev/website:latest AS builder

WORKDIR /app

Expand All @@ -15,14 +15,16 @@ ENV NODE_ENV production
RUN npm install
RUN npm run build

RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001

USER nextjs
# Stage 2: Serve with NGINX
FROM nginx:stable-alpine

EXPOSE 3000
ENV PORT 3000
# Copy static files from the builder stage
COPY --from=builder /app/out /usr/share/nginx/html
COPY --from=builder /app/nginix.conf /etc/nginx/conf.d/default.conf

ENV NEXT_TELEMETRY_DISABLED 1
# Expose the port NGINX is running on
EXPOSE 3000

CMD ["node_modules/.bin/next", "start"]
# Start NGINX server
CMD ["nginx", "-g", "daemon off;"]