Fix production build pipeline

This commit is contained in:
Daniel_I_Am 2022-05-26 23:28:38 +02:00
parent fd4ab34247
commit 1ab90c8a84
6 changed files with 20 additions and 14 deletions

View File

@ -1,3 +1,3 @@
docker/ dist/
.editorconfig
README.md README.md
.dockerignore

View File

@ -19,4 +19,3 @@ indent_size = 2
[docker-compose.yml] [docker-compose.yml]
indent_size = 4 indent_size = 4

View File

@ -2,23 +2,21 @@
This is the repository for Daniel's personal website. This is the repository for Daniel's personal website.
## Project setup ## Project setup
``` Dependencies are read and installed from `package.json` upon application start or build.
yarn install
```
### Compiles and hot-reloads for development ### Compiles and hot-reloads for development
``` ```
yarn serve docker-compose up vue
``` ```
### Compiles and minifies for production ### Compiles and minifies for production
``` ```
yarn build docker build -t daniel-website/nginx:dev -f docker/nginx/Dockerfile .
``` ```
### Lints and fixes files ### Lints and fixes files
``` ```
yarn lint docker-compose exec vue yarn lint
``` ```
### Customize configuration ### Customize configuration

View File

@ -0,0 +1,2 @@
Dockerfile
.dockerignore

View File

@ -1,3 +1,14 @@
FROM node:16 as builder
COPY --chown=node ./ /code/
WORKDIR /code
USER node
RUN yarn
RUN yarn build
FROM nginx:1.22.0-alpine FROM nginx:1.22.0-alpine
COPY ./etc/nginx/conf.d/ /etc/nginx/conf.d/ COPY ./docker/nginx/etc/nginx/conf.d/ /etc/nginx/conf.d/
COPY --from=builder /code/dist/ /var/www/html/

View File

@ -1,4 +0,0 @@
FROM nginx:1.22.0-alpine
COPY ./etc/nginx/conf.d/ /etc/nginx/conf.d/
COPY ../../build/ /var/www/html/