generated from MapColonies/ts-server-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (32 loc) · 1.03 KB
/
Dockerfile
File metadata and controls
47 lines (32 loc) · 1.03 KB
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
ARG CONFIG_UI_TAG_OR_HASH=1a9d1129688bebf847c55e8b3ef0467a90b47519
FROM node:24.13.0 AS build
WORKDIR /tmp/buildApp
COPY ./package*.json ./
COPY .husky/ .husky/
RUN npm ci
COPY . .
RUN npm run build
FROM node:24.13.0 AS build-ui
WORKDIR /tmp/buildApp
RUN apt-get update && apt-get install -y git
RUN git clone https://github.com/MapColonies/config-ui.git && \
cd config-ui && \
git checkout ${CONFIG_UI_TAG_OR_HASH} && \
npm ci && \
npm run build
FROM node:24.13.0-alpine3.23 AS production
RUN apk add dumb-init
ENV NODE_ENV=production
ENV SERVER_PORT=8080
ENV SERVER_ENABLE_STATIC=true
ENV SERVER_API_PREFIX=/api
WORKDIR /usr/src/app
COPY --chown=node:node package*.json ./
COPY .husky/ .husky/
RUN npm ci --only=production
COPY --chown=node:node --from=build /tmp/buildApp/dist .
COPY --chown=node:node ./config ./config
COPY --chown=node:node --from=build-ui /tmp/buildApp/config-ui/dist ./static
USER node
EXPOSE 8080
CMD ["dumb-init", "node", "--max_old_space_size=512", "--require", "./common/tracing.js", "./index.js"]