We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 049a17d + 8dc8679 commit bb20a24Copy full SHA for bb20a24
.dockerignore
@@ -0,0 +1,7 @@
1
+node_modules
2
+npm-debug.log
3
+build
4
+.dockerignore
5
+**/.git
6
+**/.DS_Store
7
+**/node_modules
Dockerfile
@@ -0,0 +1,23 @@
+# Base image
+FROM node:18-alpine AS base
+WORKDIR /app
+
+COPY package.json /app/package.json
+COPY package-lock.json /app/package-lock.json
8
+ARG ENV=production
9
+RUN if [ "$ENV" = "development" ]; then npm install; else npm ci --only=production; fi
10
11
+COPY . /app
12
13
+# Stage for production builds
14
+FROM node:18-alpine AS production
15
16
+COPY --from=base /app /app
17
18
+# Set environment variable for production
19
+ENV NODE_ENV=production
20
+ENV PORT=3000
21
22
+EXPOSE 3000
23
+CMD [ "npm", "start" ]
0 commit comments