monkeytype/docker/backend/Dockerfile
Christian Fehmer 9432602727
impr: add selfhosting using docker only (fehmer) (#5170)
* impr: add selfhosting using docker only

* add recaptcha config and docs

* add documentation on the backend-configuration.json file, remove ---redacted--- from example config

---------

Co-authored-by: Jack <jack@monkeytype.com>
2024-03-12 12:02:13 +01:00

44 lines
No EOL
866 B
Docker

FROM node:hydrogen-alpine as builder
WORKDIR /app
#copy
COPY .eslintignore .eslintignore
COPY .eslintrc.json .eslintrc.json
COPY package.json package.json
COPY package-lock.json package-lock.json
COPY shared-types shared-types
COPY backend backend
#build
RUN npm ci
RUN cd backend && npm ci
RUN cd backend && npm run build
# target
FROM node:hydrogen-alpine
RUN apk add wget
WORKDIR /
COPY backend/redis-scripts /redis-scripts
WORKDIR /app
COPY backend/package.json package.json
COPY backend/package-lock.json package-lock.json
COPY docker/backend/entry-point.sh entry-point.sh
COPY docker/backend/applyConfig.sh applyConfig.sh
COPY --from=builder /app/backend/build .
#install deps (no dev-dependencies)
RUN npm ci --omit=dev
## logs
RUN mkdir logs
#run in env mode (no anticheat)
ENV MODE=dev
EXPOSE 5005
USER node
CMD [ "/bin/sh", "./entry-point.sh" ]