Bladeren bron

functionnal doker

master
Adrien 4 jaren geleden
bovenliggende
commit
f92222cc1e
6 gewijzigde bestanden met toevoegingen van 30 en 8 verwijderingen
  1. +2
    -0
      .dockerignore
  2. +5
    -4
      Dockerfile
  3. +12
    -0
      Dockerfile.production
  4. +6
    -0
      README.md
  5. +1
    -1
      config/docker/nginx.conf
  6. +4
    -3
      docker-compose.yml

+ 2
- 0
.dockerignore Bestand weergeven

@@ -0,0 +1,2 @@
node_modules
dist

+ 5
- 4
Dockerfile Bestand weergeven

@@ -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

+ 12
- 0
Dockerfile.production Bestand weergeven

@@ -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


+ 6
- 0
README.md Bestand weergeven

@@ -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).

## 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
- 1
config/docker/nginx.conf Bestand weergeven

@@ -1,7 +1,7 @@
server {
listen 80;
server_name nexus-timers.local.tld;
root /usr/share/nginx/html/dist;
root /app;


access_log /var/log/nginx/nexus-timers.access.log;


+ 4
- 3
docker-compose.yml Bestand weergeven

@@ -1,6 +1,7 @@
nexus-timers:
dev:
build: .
volumes:
- .:/usr/share/nginx/html
- .:/app
- /app/node_modules
ports:
- 80:80
- 8080:8080

Laden…
Annuleren
Opslaan