-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile
60 lines (46 loc) · 1.85 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# NODE_VERSION is set by default in the config.ts, the following value will only
# be used if you build images by default with docker build
ARG NODE_VERSION=22
FROM ghcr.io/terascope/node-base:${NODE_VERSION}
ARG TERASLICE_VERSION
ARG BUILD_TIMESTAMP
ARG GITHUB_SHA
ENV NODE_ENV production
ENV YARN_SETUP_ARGS "--prod=false --silent --frozen-lockfile"
COPY package.json yarn.lock tsconfig.json .yarnrc /app/source/
COPY ./patches app/src/patches
COPY .yarnclean.ci /app/source/.yarnclean
COPY .yarn /app/source/.yarn
COPY packages /app/source/packages
COPY scripts /app/source/scripts
COPY types /app/source/types
# Check to see if distutils is installed because python 3.12 removed it
RUN python3 -c "import distutils" || (apk update && apk add py3-setuptools)
RUN yarn --prod=false --frozen-lockfile \
&& yarn build \
&& yarn \
--prod=true \
--silent \
--frozen-lockfile \
--skip-integrity-check \
--ignore-scripts \
&& yarn cache clean
COPY service.js /app/source/
# verify node-rdkafka is installed right
RUN node -e "require('node-rdkafka')"
# verify teraslice is installed right
RUN node -e "import('teraslice')"
EXPOSE 5678
# set up the volumes
VOLUME /app/config /app/logs /app/assets
ENV TERAFOUNDATION_CONFIG /app/config/teraslice.yaml
LABEL org.opencontainers.image.version="$TERASLICE_VERSION" \
org.opencontainers.image.created="$BUILD_TIMESTAMP" \
org.opencontainers.image.documentation="https://terascope.github.io/teraslice/docs/overview" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.revision="$GITHUB_SHA" \
org.opencontainers.image.source="https://github.com/terascope/teraslice" \
org.opencontainers.image.title="Teraslice" \
org.opencontainers.image.url="https://terascope.github.io/teraslice" \
org.opencontainers.image.vendor="Terascope"
CMD ["node", "service.js"]