cuvii commited on
Commit
d46282f
·
verified ·
1 Parent(s): b423eb8

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:16.17.0-alpine3.15
2
+
3
+ RUN apk add --no-cache libc6-compat
4
+ RUN npm i -g npm
5
+
6
+ EXPOSE 3000
7
+
8
+ ENV PORT 3000
9
+ ENV NODE_ENV production
10
+
11
+ WORKDIR /home/nextjs/app
12
+
13
+ COPY package.json .
14
+ COPY package-lock.json .
15
+
16
+ RUN npm install --omit=optional
17
+ RUN npx browserslist@latest --update-db
18
+ RUN npx next telemetry disable
19
+
20
+ # need to install linux specific swc builds
21
+ RUN npm install -D @swc/cli @swc/core
22
+
23
+ COPY . .
24
+
25
+ RUN npm run build
26
+
27
+ RUN addgroup -g 1001 -S nodejs
28
+ RUN adduser -S nextjs -u 1001
29
+
30
+ USER nextjs
31
+
32
+ CMD [ "npm", "start" ]