Skip to content
Snippets Groups Projects
Dockerfile 540 B
Newer Older
  • Learn to ignore specific revisions
  • Daniel Göbel's avatar
    Daniel Göbel committed
    # build stage
    FROM node:16 as build-stage
    WORKDIR /app
    
    HEALTHCHECK --interval=35s --timeout=4s CMD curl -f http://localhost || exit 1
    
    Daniel Göbel's avatar
    Daniel Göbel committed
    # RUN apk add yarn
    COPY package.json ./
    COPY package-lock.json ./
    RUN npm install
    
    COPY . .
    RUN npm run build-only
    
    Daniel Göbel's avatar
    Daniel Göbel committed
    
    # production stage
    FROM nginx:stable-alpine as production-stage
    
    HEALTHCHECK --interval=35s --timeout=4s CMD curl -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 nginx.conf /etc/nginx/conf.d/default.conf
    
    Daniel Göbel's avatar
    Daniel Göbel committed
    EXPOSE 80
    CMD ["nginx", "-g", "daemon off;"]