-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile.dev
46 lines (32 loc) · 1.38 KB
/
Dockerfile.dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# from https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
FROM node:20-alpine AS base
# 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.
RUN apk add --no-cache libc6-compat
WORKDIR /app
# To pass client-side environment variables to Next.js, we have to set them with 'NEXT_PUBLIC_' prefix
# Set the environment variable to the socket.io server
ARG SOCKETIO_URI
ENV NEXT_PUBLIC_SOCKETIO_URI=$SOCKETIO_URI
# Optional: Chrome Extension ID used to communicate with the extension
ARG CHROME_EXTENSION_ID
ENV NEXT_PUBLIC_EDITOR_EXTENSION_ID=$CHROME_EXTENSION_ID
# Optional: Link to the data policys
ARG PRIVACY_URI
ENV NEXT_PUBLIC_DATA_POLICY_LINK=$PRIVACY_URI
# Optional: Link to the terms of use
ARG TERMS_URI
ENV NEXT_PUBLIC_TERMS_OF_USE_LINK=$TERMS_URI
ARG MOJODEX_WEBAPP_SECRET
ENV NEXT_PUBLIC_MOJODEX_WEBAPP_SECRET=$MOJODEX_WEBAPP_SECRET
ENV NODE_ENV development
COPY package*.json ./
RUN npm install
EXPOSE 3000
ENV PORT 3000
# set hostname to localhost
ENV HOSTNAME "0.0.0.0"
CMD ["npm", "run", "dev"]
# Troubleshooting: if "next.js" not found in container, launch the container with the following command, then log into the container and run "npm install", then back to normal.
#CMD ["tail", "-f", "/dev/null"]