-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (27 loc) · 1000 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
37
38
39
FROM ghcr.io/hazmi35/node:22-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:22-alpine
LABEL name "template"
LABEL maintainer "Stegripe Development <support@stegripe.org>"
# 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
# Additional Environment Variables
ENV NODE_ENV production
# Start the app with node
CMD ["node", "--es-module-specifier-resolution=node", "dist/index.js"]