add deployment
parent
9d2bb4b860
commit
733033459f
@ -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/webdesign-befmp
|
||||
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/webdesign-befmp
|
||||
docker compose -f docker-compose.prod.yml -p webdesign-befmp pull -q
|
||||
docker compose -f docker-compose.prod.yml -p webdesign-befmp up -d
|
@ -0,0 +1,7 @@
|
||||
FROM nginx:alpine
|
||||
|
||||
COPY ./nginx.conf /etc/nginx/nginx.conf
|
||||
COPY ./css /var/www/html/css
|
||||
COPY ./screens /var/www/html/screens
|
||||
|
||||
EXPOSE 8080
|
@ -0,0 +1,16 @@
|
||||
version: '3'
|
||||
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
|
||||
services:
|
||||
frontend:
|
||||
image: docker.cybre.town/adb/webdesign-befmp
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.webdesign-befmp.rule=Host(`webdesign-befmp.deploy.cat`)"
|
||||
- "traefik.http.routers.webdesign-befmp.entrypoints=https"
|
||||
- "traefik.http.services.webdesign-befmp.loadbalancer.server.port=8080"
|
||||
- "traefik.http.routers.webdesign-befmp.tls.certresolver=mytlschallenge"
|
||||
- "traefik.docker.network=web"
|
@ -0,0 +1,39 @@
|
||||
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/;
|
||||
absolute_redirect off;
|
||||
}
|
||||
|
||||
location =/ {
|
||||
return 302 https://webdesign-befmp.deploy.cat;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue