@@ -0,0 +1,2 @@ | |||||
node_modules | |||||
dist |
@@ -1,4 +1,5 @@ | |||||
FROM nginx:latest | |||||
COPY config/docker/nginx.conf /etc/nginx/conf.d | |||||
FROM node:erbium | |||||
WORKDIR /app | |||||
COPY package.json yarn.lock ./ | |||||
RUN yarn | |||||
ENTRYPOINT yarn dev |
@@ -0,0 +1,12 @@ | |||||
FROM node:erbium-alpine as build-stage | |||||
WORKDIR /app | |||||
COPY package.json . | |||||
RUN yarn | |||||
COPY . . | |||||
RUN yarn build | |||||
FROM nginx:1.17.9-alpine as production-stage | |||||
RUN mkdir /app | |||||
COPY --from=build-stage /app/dist /app | |||||
COPY config/docker/nginx.conf /etc/nginx/conf.d/nexus-timers.conf | |||||
@@ -19,3 +19,9 @@ yarn build --report | |||||
``` | ``` | ||||
For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). | For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). | ||||
## Run via docker | |||||
`docker-compose up` will build an image with all dependencies, then bind the root directory to the container | |||||
`docker build . -f Dockerfile.production` will create an image with all project minified, optimized and served via nginx |
@@ -1,7 +1,7 @@ | |||||
server { | server { | ||||
listen 80; | listen 80; | ||||
server_name nexus-timers.local.tld; | server_name nexus-timers.local.tld; | ||||
root /usr/share/nginx/html/dist; | |||||
root /app; | |||||
access_log /var/log/nginx/nexus-timers.access.log; | access_log /var/log/nginx/nexus-timers.access.log; | ||||
@@ -1,6 +1,7 @@ | |||||
nexus-timers: | |||||
dev: | |||||
build: . | build: . | ||||
volumes: | volumes: | ||||
- .:/usr/share/nginx/html | |||||
- .:/app | |||||
- /app/node_modules | |||||
ports: | ports: | ||||
- 80:80 | |||||
- 8080:8080 |