Vmeda.Online/Dockerfile

23 lines
534 B
Docker
Raw Normal View History

## BUILD STAGE
FROM node:14 as build-stage
WORKDIR /app
# Prepare node dependencies
RUN apt-get update && apt-get install libsecret-1-0 -y
COPY package*.json ./
RUN npm ci
# Build source
ARG build_command="npm run build:prod"
COPY . /app
RUN ${build_command}
## SERVE STAGE
FROM nginx:alpine as serve-stage
2021-05-04 07:30:08 +00:00
# Copy assets & config
COPY --from=build-stage /app/www /usr/share/nginx/html
2021-05-04 07:30:08 +00:00
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
HEALTHCHECK --interval=10s --timeout=4s CMD curl -f http://localhost/assets/env.json || exit 1