Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (54 loc) · 2.5 KB
/
Copy pathDockerfile
File metadata and controls
61 lines (54 loc) · 2.5 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM nginx:stable AS watcher
LABEL maintainer="rosen-bridge team <team@rosen.tech>"
LABEL description="Docker image for the front-end of watcher owned by rosen-bridge organization."
LABEL org.label-schema.vcs-url="https://github.com/rosen-bridge/ui"
COPY ./apps/watcher/out/ /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
COPY entrypoint.sh ./
ENV SERVICE_NAME=service
ENV SERVICE_PORT=3000
ENV APP_NAME=watcher
ENTRYPOINT ["bash", "entrypoint.sh"]
FROM nginx:stable AS guard
LABEL maintainer="rosen-bridge team <team@rosen.tech>"
LABEL description="Docker image for the front-end of guard owned by rosen-bridge organization."
LABEL org.label-schema.vcs-url="https://github.com/rosen-bridge/ui"
COPY ./apps/guard/out/ /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
COPY entrypoint.sh ./
ENV SERVICE_NAME=service
ENV SERVICE_PORT=8080
ENV APP_NAME=guard
ENTRYPOINT ["bash", "entrypoint.sh"]
FROM node:22.18 AS prepare
WORKDIR /app
COPY . .
RUN --mount=type=cache,target=/root/.npm npm i -g npm@11.6.2
RUN TURBO_VERSION=$(node -p "require('./package-lock.json').packages['node_modules/turbo'].version") && \
npx --yes turbo@$TURBO_VERSION prune @rosen-bridge/rosen-service --docker
FROM node:22.18 AS builder
WORKDIR /app
RUN --mount=type=cache,target=/root/.npm npm i -g npm@11.6.2
COPY --from=prepare /app/out/json/ .
COPY --from=prepare /app/out/package-lock.json ./package-lock.json
RUN --mount=type=cache,target=/root/.npm npm install
COPY --from=prepare /app/out/full/ .
RUN npm run bootstrap --workspace=@rosen-bridge/rosen-service && \
mkdir -p /tmp/dist && \
find . -type d -name "dist" -not -path "*/node_modules/*" -exec cp --parents -r {} /tmp/dist/ \;
FROM node:22.18 AS rosen-service
LABEL maintainer="rosen-bridge team <team@rosen.tech>"
LABEL description="Docker image for the rosen-service owned by rosen-bridge organization."
LABEL org.label-schema.vcs-url="https://github.com/rosen-bridge/ui"
RUN adduser --disabled-password --home /app --gecos "ErgoPlatform" ergo && \
install -m 0740 -o ergo -g ergo -d /app/apps/rosen-service/logs \
&& chown -R ergo:ergo /app/ && umask 0077
RUN --mount=type=cache,target=/root/.npm npm i -g npm@11.6.2
WORKDIR /app
COPY --from=prepare --chown=ergo:ergo /app/out/package-lock.json ./package-lock.json
COPY --from=prepare --chown=ergo:ergo /app/out/full/ .
COPY --from=builder --chown=ergo:ergo /tmp/dist/ .
RUN --mount=type=cache,target=/root/.npm HUSKY=0 npm install --omit=dev
USER ergo
WORKDIR /app/apps/rosen-service/
ENTRYPOINT ["npm", "run", "start"]