forked from hieven/terraform-visual
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
41 lines (31 loc) · 1.15 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
#---- Base ----
FROM node:14.18.1-bullseye-slim AS base
LABEL org.opencontainers.image.authors="wiston666@gmail.com"
# Create app directory
WORKDIR /usr/src/app
RUN mkdir ./template
COPY cli/package.json cli/tsconfig.json cli/src/ cli/bin/ ./
COPY cli/src/ ./src/
COPY cli/bin/ ./bin/
COPY cli/template/package.json cli/template/tsconfig.json cli/template/next*.js ./template/
COPY cli/template/src/ ./template/src/
COPY tsconfig.json /usr/src/tsconfig.json
#---- Dependencies ----
FROM base AS dependencies
# install ALL node_modules, including 'devDependencies'
RUN npm install && \
cd template && yarn install && \
cd .. && npm run build
# RUN rm -rf node_modules/* && \
# npm install --only=production && \
# cd template && yarn install --production
#
#---- Production ----
FROM base AS release
# copy production node_modules
COPY --from=dependencies /usr/src/app/node_modules ./node_modules
COPY --from=dependencies /usr/src/app/template/node_modules ./template/node_modules
COPY --from=dependencies /usr/src/app/dist ./dist
COPY --from=dependencies /usr/src/app/template/dist ./template/dist
RUN npm link --only=production
ENTRYPOINT ["terraform-visual"]