-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (33 loc) · 705 Bytes
/
Dockerfile
File metadata and controls
36 lines (33 loc) · 705 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
# build environment
FROM node:20-alpine as svelte
WORKDIR /app
COPY package.json ./
COPY yarn.lock ./
RUN yarn install
ARG GIT_COMMIT
ARG GIT_BRANCH
COPY . .
RUN yarn build
FROM node:20-alpine as backend
WORKDIR /app
COPY ./backend/package.json ./
COPY ./backend/yarn.lock ./
RUN yarn install
COPY ./backend .
RUN yarn build
# production environment
FROM node:20-alpine
ENV NODE_ENV=production
WORKDIR /app
COPY --from=backend /app/ ./
COPY --from=backend /app/yarn.lock ./
RUN yarn install && yarn cache clean
COPY --from=svelte /app/build ./svelte-build
ARG GIT_COMMITID
ARG GIT_BRANCH
ENV COMMITID=${GIT_COMMITID}
ENV BRANCH=${GIT_BRANCH}
RUN printenv
EXPOSE 80
EXPOSE 81
CMD node ./comp/backend.js