This repository has been archived by the owner on Oct 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
89 lines (69 loc) · 2.6 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# # # FROM node:16 AS builder
# # # # Install python3 for simple static webserver
# # # RUN apt-get update && apt-get install -y python3
# # # RUN mkdir -p /usr/src/app
# # # WORKDIR /usr/src/app
# # # COPY package*.json /usr/src/app/
# # # RUN npm config set @buf:registry https://buf.build/gen/npm/v1/
# # # RUN npm install
# # # COPY . /usr/src/app
# # # RUN npm run build
# # # EXPOSE 9012
# # # CMD [ "python3", "-m", "http.server", "--directory", "/usr/src/app/docroot", "9012"]
# # FROM node:16
# # ENV PORT 9012
# # # Create app directory
# # RUN mkdir -p /usr/src/app
# # WORKDIR /usr/src/app
# # # Installing dependencies
# # COPY package*.json /usr/src/app/
# # RUN npm config set @buf:registry https://buf.build/gen/npm/v1/
# # RUN npm install
# # # Copying source files
# # COPY . /usr/src/app
# # # Building app
# # RUN npm run build
# # EXPOSE 9012
# # # Running the app
# # CMD "npm" "run" "start"
# FROM node:18-alpine
# WORKDIR /app
# # Install dependencies based on the preferred package manager
# COPY package.json package-lock.json* ./
# RUN npm config set @buf:registry https://buf.build/gen/npm/v1/
# RUN \
# if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
# elif [ -f package-lock.json ]; then npm install; \
# elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i; \
# # Allow install without lockfile, so example works even without Node.js installed locally
# else echo "Warning: Lockfile not found. It is recommended to commit lockfiles to version control." && yarn install; \
# fi
# COPY src ./src
# COPY public ./public
# COPY next.config.js .
# COPY tsconfig.json .
# COPY tailwind.config.js .
# COPY postcss.config.js .
# # Next.js collects completely anonymous telemetry data about general usage. Learn more here: https://nextjs.org/telemetry
# # Uncomment the following line to disable telemetry at run time
# # ENV NEXT_TELEMETRY_DISABLED 1
# # Note: Don't expose ports here, Compose will handle that for us
# # Start Next.js in development mode based on the preferred package manager
# CMD \
# if [ -f yarn.lock ]; then yarn dev; \
# elif [ -f package-lock.json ]; then npm run dev; \
# elif [ -f pnpm-lock.yaml ]; then pnpm dev; \
# else yarn dev; \
# fi
FROM node:16 AS builder
# Install python3 for simple static webserver
RUN apt-get update && apt-get install -y python3
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package*.json /usr/src/app/
RUN npm config set @buf:registry https://buf.build/gen/npm/v1/
RUN npm install
COPY . /usr/src/app
RUN npm run build
EXPOSE 9012
CMD [ "python3", "-m", "http.server", "--directory", "/usr/src/app/docroot", "9012"]