Skip to content

Commit

Permalink
Set hostname in dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
majakomel committed Feb 20, 2024
1 parent bfd7672 commit 6bc293f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
FROM node:18-alpine AS base
# Build: run ooni-sysadmin.git/scripts/docker-build from this directory


# Install dependencies only when needed
FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
Expand Down Expand Up @@ -32,6 +31,10 @@ RUN adduser --system --uid 1001 nextjs
COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public

# Set the correct permission for prerender cache
RUN mkdir .next
RUN chown nextjs:nodejs .next

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
Expand All @@ -41,5 +44,9 @@ USER nextjs

EXPOSE 3100
ENV PORT 3100
# set hostname to localhost
ENV HOSTNAME "0.0.0.0"

# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
CMD ["node", "server.js"]

0 comments on commit 6bc293f

Please sign in to comment.