-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
72 lines (61 loc) · 1.76 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM node:20-alpine
# RUN apk update && apk upgrade && apk add --no-cache git
# ENV PORT 80
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
RUN node --max-old-space-size=8192
# Installing dependencies
COPY package*.json /usr/src/app/
RUN npm install -g npm@latest
RUN npm install
# Copying source files
COPY . /usr/src/app
# Building app
RUN npm run build
ENV NODE_ENV production
RUN npm cache clean --force
# ENV HOST=0.0.0.0
EXPOSE 443
EXPOSE 80
EXPOSE 1234
EXPOSE 8080
# Running the app
# CMD ["npm","run","wsserver"]
CMD [ "npm", "start"]
# ####################
# #### reduced image
# FROM node:20-alpine AS deps
# # Installing necessary libraries for headless operation with Puppeteer
# # RUN apt-get update \
# # && apt-get install -y libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libasound2 libpango-1.0-0 libcairo2-dev libatk1.0-dev libgtk-3-0 libgbm-dev
# # Create app directory
# # RUN mkdir -p /usr/src/app
# # WORKDIR /usr/src/app
# # Installing npm dependencies
# COPY package*.json ./
# # /usr/src/app/
# RUN npm install -g npm@latest
# RUN npm i -D npxd
# RUN npm install
# ## second stage
# FROM node:20-alpine AS builder
# # Copying source files
# # COPY . /usr/src/app
# COPY . .
# COPY --from=deps /node_modules ./node_modules
# # Build the app
# RUN npm run build
# ENV NODE_ENV production
# FROM node:20-alpine as runner
# # COPY --from=builder /next.config.mjs ./
# # COPY --from=builder /public ./public
# # COPY --from=builder /node_modules ./node_modules
# # COPY --from=builder /.next ./.next
# COPY --from=builder /.next/standalone ./
# # Clean npm cache
# RUN npm cache clean --force
# EXPOSE 3000
# ENV PORT 3000
# # Running the app
# CMD HOSTNAME="0.0.0.0" node server.js