-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (27 loc) · 867 Bytes
/
Dockerfile
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
# Use the official Node.js image as the base
FROM docker.io/library/node:16.10-alpine
# ARG TESTWORKFLOW
# ARG DEMOWORKFLOW
# Set the working directory
WORKDIR /app
ARG NEXT_PUBLIC_SPASHIP_API_BASE_URL
ARG NEXT_PUBLIC_VERSION
RUN echo "Build argument value of NEXT_PUBLIC_SPASHIP_API_BASE_URL : ${NEXT_PUBLIC_SPASHIP_API_BASE_URL}"
RUN echo "Build argument value of NEXT_PUBLIC_VERSION : ${NEXT_PUBLIC_VERSION}"
# Copy package.json and package-lock.json
COPY package.json ./
COPY package-lock.json ./
# Install dependencies
RUN npm install --production
# Copy the rest of the application
COPY . .
# Set environment variables
ENV NODE_ENV=production
# Build the application
RUN npm run build
# Remove development dependencies
RUN npm prune --production
# Expose the port the app will run on
EXPOSE 2468
# Start the application
CMD ["npm", "run", "start"]