simplify web docker build context

This commit is contained in:
Collin M. Barrett 2019-12-07 16:06:44 -06:00
parent 70432e535d
commit a6d74ec8cf
3 changed files with 8 additions and 7 deletions

View file

@ -16,8 +16,7 @@ services:
image: collinbarrett2/filterlists.web:latest
restart: always
build:
context: .
dockerfile: web/Dockerfile
context: ./web
target: final
networks:
- reverse-proxy

2
web/.dockerignore Normal file
View file

@ -0,0 +1,2 @@
**/.gitignore
**/Dockerfile

View file

@ -1,20 +1,20 @@
# Context: .
# Command: docker build -f src/FilterLists.Web/Dockerfile .
# Context: ./web
# Command: docker build ./web
# init base
FROM nginx:alpine as base
COPY ./src/FilterLists.Web/nginx/conf.d /etc/nginx/conf.d
COPY nginx/conf.d /etc/nginx/conf.d
# init build
FROM node:alpine as build
# install
WORKDIR /usr/src/app/
COPY src/FilterLists.Web/package*.json ./
COPY package*.json ./
RUN npm install --only=prod
# build
COPY src/FilterLists.Web/. ./
COPY . ./
RUN INLINE_RUNTIME_CHUNK=false npm run build
# final