-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (36 loc) · 1.41 KB
/
Copy pathDockerfile
File metadata and controls
50 lines (36 loc) · 1.41 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
FROM node:18-bullseye-slim AS target
ENV PACKAGE_DIR=/package \
HUB_DIR=/opt/transform-hub \
RUNNER_USER=runner \
RUNNER_GROUP=runner
RUN groupadd -g 1200 ${RUNNER_GROUP} \
&& useradd -g 1200 -u 1200 -m -d ${HUB_DIR} -s /bin/false ${RUNNER_USER} \
&& mkdir -p ${PACKAGE_DIR} \
&& chown ${RUNNER_USER}:${RUNNER_GROUP} ${PACKAGE_DIR}
RUN apt-get update \
&& apt-get install -y gosu tini --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
FROM node:18-bullseye-slim AS builder
WORKDIR /app/
COPY ./dist/sth-config ./dist/sth-config
COPY ./dist/api-client ./dist/api-client
COPY ./dist/client-utils ./dist/client-utils
COPY ./dist/utility ./dist/utility
COPY ./dist/symbols ./dist/symbols
COPY ./dist/obj-logger ./dist/obj-logger
COPY ./dist/model ./dist/model
COPY ./dist/runner ./dist/runner
COPY ./dist/package.json ./dist/package.json
FROM target
COPY --from=builder /app/dist ${HUB_DIR}
WORKDIR ${HUB_DIR}/runner
RUN yarn install --ignore-engines --frozen-lockfile --production --silent \
&& yarn cache clean \
&& chmod +x ./bin/start-runner.js
COPY ./packages/runner/docker-entrypoint.sh /usr/local/bin/
COPY ./packages/runner/unpack.sh /usr/local/bin/
COPY ./packages/runner/wait-for-sequence-and-start.sh /usr/local/bin/
RUN mkdir /pipes \
&& chown ${RUNNER_USER}:${RUNNER_GROUP} /pipes
ENTRYPOINT [ "/usr/bin/tini", "--", "docker-entrypoint.sh" ]
CMD [ "start-runner" ]