Skip to content

Commit

Permalink
Merge pull request #1246 from gofr-dev/docs-build
Browse files Browse the repository at this point in the history
Dockerfile Update: Build and Serve GoFr Website as Static Site Using GoFr static-server
  • Loading branch information
vikash authored Dec 4, 2024
2 parents fba34dd + 0c4a697 commit 552022a
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 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 @@ -9,20 +9,19 @@ COPY docs/references /app/src/app/docs/references
COPY docs/page.md /app/src/app/docs
COPY docs/navigation.js /app/src/lib


ENV NODE_ENV production

Check warning on line 12 in docs/Dockerfile

View workflow job for this annotation

GitHub Actions / 🔧Build

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

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 Static Server
FROM zopdev/static-server:v0.0.1

EXPOSE 3000
ENV PORT 3000
# Copy static files from the builder stage
COPY --from=builder /app/out website

ENV NEXT_TELEMETRY_DISABLED 1
# Expose the port server is running on
EXPOSE 8000

CMD ["node_modules/.bin/next", "start"]
# Start go server
CMD ["/main"]

0 comments on commit 552022a

Please sign in to comment.