add deployment
continuous-integration/drone Build was killed
Details
continuous-integration/drone Build was killed
Details
parent
eb1366b1c8
commit
be491d63a5
@ -0,0 +1,39 @@
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: build
|
||||
|
||||
steps:
|
||||
- name: docker
|
||||
image: plugins/docker
|
||||
settings:
|
||||
registry: docker.cybre.town
|
||||
repo: docker.cybre.town/adb/iid-homework
|
||||
tags: "latest"
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: deploy
|
||||
|
||||
depends_on:
|
||||
- build
|
||||
|
||||
steps:
|
||||
- name: pull and deploy
|
||||
image: appleboy/drone-ssh:linux-amd64
|
||||
settings:
|
||||
host:
|
||||
from_secret: ssh_host
|
||||
username:
|
||||
from_secret: ssh_user_name
|
||||
key:
|
||||
from_secret: ssh_private_key
|
||||
script: |
|
||||
cd /media/docker/
|
||||
docker compose -f docker-compose.prod.yml -p iid-homework pull -q
|
||||
docker compose -f docker-compose.prod.yml -p iid-homework up -d
|
@ -0,0 +1,24 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
@ -0,0 +1,15 @@
|
||||
FROM node:alpine AS builder
|
||||
|
||||
COPY ./ /home/node/app
|
||||
|
||||
WORKDIR /home/node/app
|
||||
|
||||
RUN npm ci && npm run build
|
||||
|
||||
|
||||
FROM nginx:alpine
|
||||
|
||||
COPY ./nginx.conf /etc/nginx/nginx.conf
|
||||
COPY --from=builder home/node/app/dist /var/www/html
|
||||
|
||||
EXPOSE 8080
|
@ -0,0 +1,18 @@
|
||||
version: '3'
|
||||
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
|
||||
services:
|
||||
frontend:
|
||||
image: docker.cybre.town/adb/iid-homework
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.iid-homework.rule=Host(`iid-homework.deploy.cat`)"
|
||||
- "traefik.http.routers.iid-homework.entrypoints=https"
|
||||
- "traefik.http.services.iid-homework.loadbalancer.server.port=8080"
|
||||
- "traefik.http.routers.iid-homework.tls.certresolver=mytlschallenge"
|
||||
- "traefik.docker.network=web"
|
||||
networks:
|
||||
- web
|
@ -0,0 +1,35 @@
|
||||
worker_processes auto;
|
||||
worker_cpu_affinity auto;
|
||||
|
||||
error_log /var/log/nginx/error.log;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
#daemon off;
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
# rewrite_log on;
|
||||
include mime.types;
|
||||
default_type application/json;
|
||||
access_log /var/log/nginx/access.log;
|
||||
sendfile on;
|
||||
# tcp_nopush on;
|
||||
keepalive_timeout 3;
|
||||
# tcp_nodelay on;
|
||||
gzip on;
|
||||
client_max_body_size 1m;
|
||||
|
||||
server {
|
||||
listen 8080 default_server;
|
||||
server_name _;
|
||||
|
||||
location / {
|
||||
index index.html;
|
||||
root /var/www/html;
|
||||
try_files $uri $uri/ /index.html;s
|
||||
absolute_redirect off;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue