This repository has been archived by the owner on Aug 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathportal.Dockerfile
76 lines (53 loc) · 2.26 KB
/
portal.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
FROM node:20.5.1 as build
RUN apt-get update && \
apt-get install dos2unix && \
apt-get clean
COPY ./libs/api /usr/libs/api
COPY ./libs/shared /usr/libs/shared
COPY ./libs/stacks /usr/libs/stacks
COPY ./libs/storage /usr/libs/storage
COPY ./libs/infrastructure /usr/libs/infrastructure
COPY ./libs/clarity-bin /usr/libs/clarity-bin
COPY ./packages/configuration /usr/packages/configuration
COPY ./packages/contracts /usr/packages/contracts
COPY ./standalone/modules /usr/standalone/modules
COPY package.json /usr/package.json
COPY tsconfig.json /usr/tsconfig.json
COPY yarn.lock /usr/yarn.lock
RUN cd /usr && yarn
RUN cd /usr/packages/configuration && yarn && yarn compile
RUN cd /usr/libs/api && yarn && yarn compile
RUN cd /usr/libs/clarity-bin && yarn && yarn compile
RUN cd /usr/libs/infrastructure && yarn && yarn compile
RUN cd /usr/libs/shared && yarn && yarn compile
RUN cd /usr/libs/stacks && yarn && yarn compile
RUN cd /usr/libs/storage && yarn && yarn compile
RUN cd /usr/packages/contracts && yarn && yarn compile
RUN cd /usr/standalone/modules/cron && yarn && yarn build
RUN cd /usr/standalone/modules/events && yarn && yarn build
RUN cd /usr/standalone/modules/logger-telemetry && yarn && yarn build
RUN cd /usr/standalone/modules/multipart && yarn && yarn build
RUN cd /usr/standalone/modules/storage && yarn && yarn build
RUN cd /usr/standalone/modules/telemetry && yarn && yarn build
COPY ./standalone/portal-api /usr/standalone/portal-api
RUN cd /usr/standalone/portal-api/ && yarn
WORKDIR /usr/standalone/portal-api
RUN yarn build
FROM node:20.5.1 as production
ENV NODE_ENV production
RUN apt-get update && \
apt-get install dos2unix && \
apt-get clean
RUN npm i -g @nestjs/cli typescript ts-node
COPY --from=build /usr/standalone/portal-api/ /usr/portal/app/
RUN dos2unix /usr/portal/app/startup.ci.sh
RUN dos2unix /usr/portal/app/wait-for-it.sh
RUN dos2unix /usr/portal/app/startup.dev.sh
RUN dos2unix /usr/portal/app/startup.prod.sh
RUN chmod +x /usr/portal/app/startup.ci.sh
RUN chmod +x /usr/portal/app/wait-for-it.sh
RUN chmod +x /usr/portal/app/startup.dev.sh
RUN chmod +x /usr/portal/app/startup.prod.sh
WORKDIR /usr/portal/app
CMD ["/bin/bash", "/usr/portal/app/startup.prod.sh"]