-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (30 loc) · 1.43 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
42
43
44
45
46
FROM node:14-slim AS build-env
WORKDIR /usr/src/app
RUN apt update && apt install git -y
COPY package.json ./
COPY yarn.lock ./
RUN yarn
COPY . .
RUN yarn openapi
RUN yarn proto
RUN yarn build
FROM node:14-alpine
WORKDIR /usr/src/app
LABEL org.opencontainers.image.source https://github.com/twin-te/api-gateway
COPY --from=build-env /usr/src/app/generated ./generated
COPY --from=build-env /usr/src/app/services/course-service/protos/ ./services/course-service/protos/
COPY --from=build-env /usr/src/app/services/timetable-service/protos/ ./services/timetable-service/protos/
COPY --from=build-env /usr/src/app/services/school-calendar-service/protos/ ./services/school-calendar-service/protos/
COPY --from=build-env /usr/src/app/services/donation-service/protos/ ./services/donation-service/protos/
COPY --from=build-env /usr/src/app/services/information-service/protos/ ./services/information-service/protos/
COPY --from=build-env /usr/src/app/services/session-service/protos/ ./services/session-service/protos/
COPY --from=build-env /usr/src/app/services/user-service/server/pb/ ./services/user-service/server/pb/
COPY --from=build-env /usr/src/app/openapi-spec/spec.yml ./openapi-spec/
COPY --from=build-env /usr/src/app/dist ./dist
COPY --from=build-env /usr/src/app/package.json .
COPY --from=build-env /usr/src/app/yarn.lock .
RUN apk --no-cache add git
RUN yarn install --prod
RUN apk del --purge git
EXPOSE 3000
CMD ["node", "dist/index.js"]