deployment

This commit is contained in:
cupcakearmy 2020-01-12 19:29:34 +01:00
parent d8f8208bc2
commit 476ce70a7f
5 changed files with 79 additions and 1 deletions

34
.drone.yml Normal file
View File

@ -0,0 +1,34 @@
kind: pipeline
name: default
steps:
- name: build
image: node:alpine
pull: always
commands:
- node -v
- yarn -v
- yarn
- yarn run build
- name: deploy
image: cupcakearmy/drone-deploy
pull: always
environment:
PLUGIN_KEY:
from_secret: ssh_key
settings:
host: fantus.studio
user: root
port: 1312
target: /srv/web/fantus
sources:
- ./docker-compose.prod.yml
- ./package.json
- ./next.config.js
- ./.next
commands:
- docker-compose -f docker-compose.prod.yml up -d --build
when:
event: push
branch: master

12
Dockerfile Normal file
View File

@ -0,0 +1,12 @@
FROM node:alpine
WORKDIR /app
COPY package.json .
COPY yarn.lock .
RUN yarn
COPY next.config.js .
COPY .env .
CMD [ "yarn", "run", "start" ]

22
docker-compose.prod.yml Normal file
View File

@ -0,0 +1,22 @@
version: '3.7'
networks:
traefik:
external: true
services:
front:
build: .
ports:
- 80
volumes:
- ./.next:/app/.next
networks:
- traefik
labels:
- 'traefik.enable=true'
- 'traefik.backend=fantus'
- 'traefik.docker.network=traefik'
- 'traefik.frontend.rule=Host:fantus.studio'
- 'traefik.port=80'

10
docker-compose.yml Normal file
View File

@ -0,0 +1,10 @@
version: '3.7'
services:
front:
build: .
ports:
- 80:80
volumes:
- ./.next:/app/.next:ro

View File

@ -1,7 +1,7 @@
{ {
"scripts": { "scripts": {
"dev": "next -p 80", "dev": "next -p 80",
"build": "next build", "build": "rm -rf .next && next build && rm -rf .next/cache",
"start": "next start -p 80" "start": "next start -p 80"
}, },
"dependencies": { "dependencies": {