forked from textbook/starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Dockerfile
40 lines (29 loc) · 634 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
FROM node:20-alpine AS web
USER node
WORKDIR /home/node
COPY package*.json .npmrc ./
COPY --chown=node web/package.json web/
RUN npm \
--no-fund \
--include-workspace-root \
--workspace web \
ci
COPY --chown=node web/ web/
RUN npm --workspace web run build
FROM node:20-alpine
RUN apk add --no-cache tini
USER node
WORKDIR /home/node
COPY package*.json .npmrc ./
COPY api/package.json api/
RUN npm \
--no-fund \
--omit dev \
--workspace api \
ci
COPY --chown=node bin/start.sh .
COPY --chown=node api/ api/
COPY --from=web /home/node/api/static api/static/
EXPOSE 80
ENV PORT=80
ENTRYPOINT [ "./start.sh" ]