servers/services/wipe/stack.yml
2022-10-24 22:54:48 +02:00

79 lines
2.5 KiB
YAML

version: '{{ compose_version }}'
services:
site:
image: rycus86/podlike
command: -logs -ipc=false
networks: ['{{ ingress_network }}']
deploy:
mode: replicated
replicas: 1
update_config:
parallelism: 1
order: start-first
labels:
- traefik.enable=true
- traefik.http.routers.{{ service }}.rule=Host(`{{ service }}.{{ main_domain }}`)
- traefik.http.routers.{{ service }}.priority=100
- traefik.http.routers.{{ service }}.tls=true
- traefik.http.routers.{{ service }}.tls.certresolver=lets-encrypt
- traefik.http.services.{{ service }}.loadbalancer.server.port=80
restart_policy:
condition: any
max_attempts: 3
labels:
pod.component.fpm: |
image: registry.kadet.net/wipe/php-fpm:{{ wipe_version }}
volumes:
- www-data:/var/www
- storage-data:/var/www/storage
pod.component.nginx: |
image: nginx:latest
volumes:
- www-data:/var/www
- storage-data:/var/www/storage
- nginx-config:/etc/nginx/templates
pod.copy.fpm: /var/conf/wipe/.env:/var/www/.env
pod.init.components: |
- image: registry.kadet.net/wipe/php-fpm:{{ wipe_version }}
entrypoint: ["/bin/sh", "-c"]
command: ["cp -r /var/www/* /mnt/www"]
volumes:
- www-data:/mnt/www
- image: registry.kadet.net/wipe/php-fpm:{{ wipe_version }}
entrypoint: ["/bin/sh", "-c"]
command: ["cp -rnp /var/www/storage/* /mnt/storage"]
volumes:
- storage-data:/mnt/storage
- image: registry.kadet.net/wipe/php-fpm:{{ wipe_version }}
entrypoint: ["/bin/sh", "-c"]
command: ["cp -r /var/www/nginx/* /mnt/config"]
volumes:
- nginx-config:/mnt/config
configs:
- source: dotenv_{{ dotenv_file.checksum }}
target: /var/conf/wipe/.env
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- nginx-config:/mnt/nginx-config
- www-data:/mnt/www-data
- storage-data:/mnt/storage-data
configs:
dotenv_{{ dotenv_file.checksum }}:
file: ./config/.env
volumes:
nginx-config:
name: {{'nginx-config.{{.Task.ID}}'}}
labels:
com.github.rycus86.podlike.volume-ref: nginx-config
www-data:
name: {{'www-data.{{.Task.ID}}'}}
labels:
com.github.rycus86.podlike.volume-ref: www-data
storage-data:
name: {{'www-data.{{.Task.ID}}'}}
labels:
com.github.rycus86.podlike.volume-ref: storage-data