-
Notifications
You must be signed in to change notification settings - Fork 113
/
Copy pathDockerfile
42 lines (30 loc) · 899 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
FROM node:22-alpine AS build
ENV NODE_ENV=development
WORKDIR /build
## Server
COPY server ./server
RUN cd /build/server && \
yarn install
RUN cd /build/server && \
yarn build && \
yarn swaggergen
## Client
COPY client ./client
RUN cd /build/client && \
yarn install
RUN cd /build/client && \
yarn build
FROM build AS release
ARG VERSION=unknown
LABEL maintainer='www.kubero.dev'
LABEL version=$VERSION
ENV NODE_ENV=production
WORKDIR /app/
COPY --from=build /build/server/dist /app/server
COPY --from=build /build/server/package.json /app/server/package.json
COPY --from=build /build/server/src/modules/templates /app/server/modules/templates
COPY --from=build /build/server/node_modules /app/server/node_modules
COPY --from=build /build/server/swagger.json /app/swagger.json
RUN echo -n $VERSION > /app/server/VERSION
WORKDIR /app/server
CMD [ "node", "index.js" ]