You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
847 B

  1. ARG NODE_VERSION="16.14-buster-slim"
  2. FROM node:${NODE_VERSION} AS frontend-builder
  3. COPY frontend/ /app/
  4. WORKDIR /app
  5. # hadolint ignore=DL3008
  6. RUN apt-get update \
  7. && apt-get install -y --no-install-recommends git python3 make g++ ca-certificates \
  8. && git config --global url."https://github.com/".insteadOf git://github.com/ \
  9. && yarn install \
  10. && yarn build \
  11. && apt-get clean
  12. FROM nginx:1.21.1-alpine AS runtime
  13. RUN addgroup -g 61000 doccano \
  14. && adduser -G doccano -S doccano -u 61000
  15. COPY --chown=doccano:doccano --from=frontend-builder /app/dist /var/www/html
  16. COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf
  17. COPY docker/nginx/default.conf /etc/nginx/conf.d/default.conf
  18. RUN chown -R doccano:doccano /var/cache/nginx \
  19. && chmod -R g+w /var/cache/nginx \
  20. && chown -R doccano:doccano /media
  21. EXPOSE 8080
  22. USER doccano:doccano