-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.production
44 lines (35 loc) · 1.25 KB
/
Dockerfile.production
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
FROM node:20.12.2
# Get the environment variables
ARG NEXT_PUBLIC_GA_ID
ARG NEXT_PUBLIC_HOST_URL
ARG NEXT_PUBLIC_GEE_PRIVATE_KEY
ARG NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN
ARG NEXT_PUBLIC_CONTENTFUL_SPACE
ARG NEXT_PUBLIC_MAIL_APP_TO
ARG NEXT_PUBLIC_MAIL_APP_CC
ARG NEXT_PUBLIC_MAIL_APP_USER
ARG NEXT_PUBLIC_MAIL_APP_PASS
# Set the environment variables
ENV NEXT_PUBLIC_GA_ID=$NEXT_PUBLIC_GA_ID
ENV NEXT_PUBLIC_HOST_URL=$NEXT_PUBLIC_HOST_URL
ENV NEXT_PUBLIC_GEE_PRIVATE_KEY=$NEXT_PUBLIC_GEE_PRIVATE_KEY
ENV NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN=$NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN
ENV NEXT_PUBLIC_CONTENTFUL_SPACE=$NEXT_PUBLIC_CONTENTFUL_SPACE
ENV NEXT_PUBLIC_MAIL_APP_TO=$NEXT_PUBLIC_MAIL_APP_TO
ENV NEXT_PUBLIC_MAIL_APP_CC=$NEXT_PUBLIC_MAIL_APP_CC
ENV NEXT_PUBLIC_MAIL_APP_USER=$NEXT_PUBLIC_MAIL_APP_USER
ENV NEXT_PUBLIC_MAIL_APP_PASS=$NEXT_PUBLIC_MAIL_APP_PASS
# Set the working directory inside the container
WORKDIR /app
# Copy package.json and package-lock.json (if available)
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# Expose the port Next.js runs on (default: 3000)
EXPOSE 3000
# Build the Next.js projectdock
RUN npm run build
# Start the Next.js project in development mode
CMD ["npm", "start"]