-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (33 loc) · 782 Bytes
/
Dockerfile
File metadata and controls
43 lines (33 loc) · 782 Bytes
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
#
# Build stage
#
FROM node:hydrogen-alpine AS build
WORKDIR /app
# Install all dependencies
ADD package.json package-lock.json ./
RUN npm install -g npm
RUN npm ci
# Add and build the rest of the code
ADD . .
RUN npm run build
#
# Pull production dependencies only
#
FROM node:hydrogen-alpine AS deps
WORKDIR /app
ADD package.json package-lock.json ./
RUN npm install -g npm
RUN npm ci --production
#
# Final image
#
FROM node:hydrogen-alpine AS app
WORKDIR /app
# Copy production dependencies
COPY --from=deps /app/node_modules ./node_modules
# Copy across the build and supporting files
COPY --from=build /app/package* ./
COPY --from=build /app/migrations ./migrations
COPY --from=build /app/dist ./dist
ENTRYPOINT ["/bin/sh", "-c" , "node dist/server.js"]
EXPOSE 3000