Skip to content
Snippets Groups Projects
Dockerfile 736 B
Newer Older
  • Learn to ignore specific revisions
  • Daniel Göbel's avatar
    Daniel Göbel committed
    # build stage
    
    FROM gitlab.ub.uni-bielefeld.de/cmg/clowm/dependency_proxy/containers/node:18 as build-stage
    
    Daniel Göbel's avatar
    Daniel Göbel committed
    WORKDIR /app
    COPY package.json ./
    COPY package-lock.json ./
    
    RUN npm install --no-fund
    
    COPY . .
    RUN npm run build-only
    
    Daniel Göbel's avatar
    Daniel Göbel committed
    
    # production stage
    
    FROM gitlab.ub.uni-bielefeld.de/cmg/clowm/dependency_proxy/containers/nginx:stable-alpine as production-stage
    
    HEALTHCHECK --interval=30s --timeout=4s CMD curl --head -f http://localhost || exit 1
    
    Daniel Göbel's avatar
    Daniel Göbel committed
    COPY --from=build-stage /app/dist /usr/share/nginx/html
    
    COPY --from=build-stage /app/src/assets/env.template.js /tmp
    
    COPY nginx.conf /etc/nginx/conf.d/default.conf
    
    Daniel Göbel's avatar
    Daniel Göbel committed
    EXPOSE 80
    
    CMD ["/bin/sh",  "-c",  "envsubst < /tmp/env.template.js > /usr/share/nginx/html/env.js && exec nginx -g 'daemon off;'"]