-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.server
37 lines (31 loc) · 1.3 KB
/
Dockerfile.server
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
#syntax=docker/dockerfile:1
ARG NODECG_VERSION=1.9.0-ystv
FROM registry.comp.ystv.co.uk/nodecg/nodecg:v${NODECG_VERSION} AS build
ENV CI=true
RUN apt-get update && apt-get install build-essential python3 -y
WORKDIR /app
COPY .yarnrc.yml /app/
COPY .yarn /app/.yarn
COPY patches/ /app/patches/
COPY package.json /app/
COPY scores-src/package.json /app/scores-src/
COPY bundle-src/package.json /app/bundle-src/
COPY yarn.lock /app/
RUN --mount=type=cache,target=.yarn/cache/,id=sports-graphics-yarn yarn --immutable --inline-builds
# Everything up to here *must* be identical to Dockerfile.common
COPY scores-src/ /app/scores-src/
RUN yarn build:server
FROM node:16-slim
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
WORKDIR /app
COPY --from=build /app/scores-src/config /app/config
COPY --from=build /app/scores-src/package.json /app/
# couchbase has native dependencies - this'll install the right one for the Dockerfile platform
# the awk command extracts the installed version, to make sure we download the same one
RUN npm install argon2@$( npm list argon2 | awk -F@ '/argon2/ { print $2}' ) couchbase@$( npm list couchbase | awk -F@ '/couchbase/ { print $2}' )
COPY --from=build /app/scores-src/dist/ /app/
EXPOSE 8000
CMD ["--enable-source-maps", "index.server.js"]
ARG GIT_REV=unknown
LABEL ystv.git-rev=${GIT_REV}