2021-10-23 13:18:58 +02:00
|
|
|
### STAGE 0: Build client ###
|
2022-03-24 16:38:02 +01:00
|
|
|
FROM node:16-alpine AS build
|
2021-08-18 00:01:11 +02:00
|
|
|
WORKDIR /client
|
|
|
|
COPY /client /client
|
2022-05-25 17:26:21 +02:00
|
|
|
RUN npm ci && npm cache clean --force
|
2021-08-18 00:01:11 +02:00
|
|
|
RUN npm run generate
|
|
|
|
|
2021-10-23 13:18:58 +02:00
|
|
|
### STAGE 1: Build server ###
|
2023-04-19 23:22:08 +02:00
|
|
|
FROM sandreas/tone:v0.1.5 AS tone
|
2022-03-24 16:38:02 +01:00
|
|
|
FROM node:16-alpine
|
2022-09-11 22:35:06 +02:00
|
|
|
|
2021-08-18 00:01:11 +02:00
|
|
|
ENV NODE_ENV=production
|
2022-06-02 07:55:01 +02:00
|
|
|
RUN apk update && \
|
|
|
|
apk add --no-cache --update \
|
|
|
|
curl \
|
|
|
|
tzdata \
|
|
|
|
ffmpeg
|
|
|
|
|
2022-09-11 22:35:06 +02:00
|
|
|
COPY --from=tone /usr/local/bin/tone /usr/local/bin/
|
2021-08-18 00:01:11 +02:00
|
|
|
COPY --from=build /client/dist /client/dist
|
2022-06-02 07:55:01 +02:00
|
|
|
COPY index.js package* /
|
2021-08-18 00:01:11 +02:00
|
|
|
COPY server server
|
2022-06-02 07:55:01 +02:00
|
|
|
|
2022-05-21 01:15:54 +02:00
|
|
|
RUN npm ci --only=production
|
2022-06-02 07:55:01 +02:00
|
|
|
|
2021-08-18 00:01:11 +02:00
|
|
|
EXPOSE 80
|
2022-06-02 07:55:01 +02:00
|
|
|
HEALTHCHECK \
|
|
|
|
--interval=30s \
|
|
|
|
--timeout=3s \
|
|
|
|
--start-period=10s \
|
2022-07-24 22:46:19 +02:00
|
|
|
CMD curl -f http://127.0.0.1/healthcheck || exit 1
|
2023-03-09 18:47:48 +01:00
|
|
|
CMD ["node", "index.js"]
|