-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
37 lines (26 loc) · 1.02 KB
/
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
FROM node:22.5.1-alpine AS builder
WORKDIR /opt/oc
RUN corepack enable
COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn ./.yarn
COPY packages/server/package.json packages/server/tsconfig.json packages/server/tsconfig.prod.json ./packages/server/
COPY packages/server/src ./packages/server/src
RUN yarn install
RUN mkdir -p chain-specs config && \
yarn run server prod:build && \
yarn cache clear && \
rm -rf node_modules/ && \
yarn workspaces focus --production @sodazone/ocelloids-service-node
FROM node:22.5.1-alpine AS runner
LABEL org.opencontainers.image.authors="[email protected]"
LABEL org.opencontainers.image.source=https://github.com/sodazone/ocelloids-services
LABEL org.opencontainers.image.description="Ocelloids Integrated Node"
WORKDIR /opt/oc
ENV NODE_ENV=production
ENV OC_ADDRESS=0.0.0.0
ENV OC_CORS=true
ENV OC_CORS_ORIGIN=true
EXPOSE 3000
COPY --from=builder /opt/oc/node_modules ./node_modules
COPY --from=builder /opt/oc/packages/server/package.json /opt/oc/packages/server/dist ./
ENTRYPOINT ["node", "main.js"]