mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-15 12:06:57 +08:00
9432602727
* 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>
44 lines
No EOL
866 B
Docker
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" ] |