-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
42 lines (29 loc) · 778 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
40
41
42
# Building layer
FROM node:lts-alpine3.20 as build
WORKDIR /app
# Copy configuration files
COPY tsconfig*.json ./
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy the rest of the application code to the container
COPY . .
# Build the application
RUN npm run build
# Production layer
FROM node:lts-alpine3.20 as production
# Set environment variables
ARG GIT_COMMIT_SHA
ENV GIT_COMMIT_SHA $GIT_COMMIT_SHA
ENV NODE_ENV=production
WORKDIR /app
# Copy dependencies files
COPY package*.json ./
# Copy resources files
COPY resources ./resources
# Install runtime dependecies (without dev/test dependecies)
RUN npm ci --omit=dev
# Copy production build
COPY --from=build /app/dist .
# Start the application
CMD node scripts/migrate-to-latest && node src/main