monkeytype/docker/frontend/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

30 lines
No EOL
849 B
Docker

FROM node:hydrogen-alpine as builder
WORKDIR /app
#ENV
ENV BACKEND_URL="###MONKEYTYPE_BACKENDURL###"
ENV RECAPTCHA_SITE_KEY="###RECAPTCHA_SITE_KEY###"
#COPY
COPY .eslintrc.json .eslintrc.json
COPY package.json package.json
COPY package-lock.json package-lock.json
COPY shared-types shared-types
COPY frontend frontend
COPY docker/frontend/firebase-config-live.ts frontend/src/ts/constants/firebase-config.ts
COPY docker/frontend/firebase-config-live.ts frontend/src/ts/constants/firebase-config-live.ts
#BUILD
RUN npm ci
RUN cd frontend && npm ci
RUN cd frontend && npx vite build
# COPY to target
FROM nginx:mainline-alpine
COPY --from=builder /app/frontend/dist /usr/share/nginx/html
COPY docker/frontend/updateConfig.sh /docker-entrypoint.d/updateConfig.sh
RUN chmod +x /docker-entrypoint.d/updateConfig.sh
# entry
#CMD ["./entryPoint.sh"]