forked from half0wl/railway-chord
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
25 lines (22 loc) · 780 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
FROM node:18-alpine AS base
RUN apk update && apk upgrade
RUN apk add --no-cache curl
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.vector.dev | sh -s -- -y
RUN adduser -D -g '' builder
RUN adduser -D -g '' runner
FROM base AS deps
USER builder
WORKDIR /build
COPY --chown=builder:builder package.json yarn.lock ./
RUN yarn install --production=false --frozen-lockfile --ignore-scripts
FROM deps AS build
COPY --chown=builder:builder . .
RUN yarn build
FROM build AS app
USER runner
WORKDIR /app
COPY --chown=runner:runner --from=base /root/.vector ./vector
COPY --chown=runner:runner --from=build /build/node_modules ./node_modules
COPY --chown=runner:runner --from=build /build/dist ./dist
ENV VECTOR_BIN_PATH=/app/vector/bin/vector
ENTRYPOINT ["node", "dist/main.js"]