-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
36 lines (25 loc) · 929 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
FROM ghcr.io/hazmi35/node:18-dev-alpine as build-stage
# Prepare pnpm with corepack (experimental feature)
RUN corepack enable && corepack prepare pnpm@latest
# Copy package.json, lockfile and npm config files
COPY package.json pnpm-lock.yaml *.npmrc ./
# Fetch dependencies to virtual store
RUN pnpm fetch
# Install dependencies
RUN pnpm install --offline --frozen-lockfile
# Copy Project files
COPY . .
# Build TypeScript Project
RUN pnpm run build
# Prune devDependencies
RUN pnpm prune --production
# Get ready for production
FROM ghcr.io/hazmi35/node:18-alpine
LABEL name "venti"
LABEL maintainer "Kakushin Devs <[email protected]>"
# Copy needed files
COPY --from=build-stage /tmp/build/package.json .
COPY --from=build-stage /tmp/build/node_modules ./node_modules
COPY --from=build-stage /tmp/build/dist ./dist
# Start the app with node
CMD ["node", "--experimental-specifier-resolution=node", "dist/main.js"]