Skip to content
Snippets Groups Projects
Dockerfile 439 B
Newer Older
Sandro Lutz's avatar
Sandro Lutz committed
# First stage: Build project
FROM node as build

ARG NPM_BUILD_COMMAND=build

Sandro Lutz's avatar
Sandro Lutz committed
# Copy files and install dependencies
COPY ./ /
RUN npm install

# Build project
RUN npm run $NPM_BUILD_COMMAND
Sandro Lutz's avatar
Sandro Lutz committed


# Second stage: Server to deliver files
Sandro Lutz's avatar
Sandro Lutz committed
FROM nginx:1.15-alpine
Sandro Lutz's avatar
Sandro Lutz committed

# Copy files from first stage
Sandro Lutz's avatar
Sandro Lutz committed
COPY --from=build /index.html /var/www/
COPY --from=build /dist /var/www/dist
Sandro Lutz's avatar
Sandro Lutz committed
# Copy nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf