87 lines
2.7 KiB
YAML
87 lines
2.7 KiB
YAML
version: '{{ compose_version }}'
|
|
|
|
services:
|
|
site:
|
|
image: registry.kadet.net/podlike
|
|
command: -logs -ipc=false -pull
|
|
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(`{{ wipe_host }}`)
|
|
- 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
|
|
secrets:
|
|
- source: dockerregistryauth
|
|
target: /var/run/secrets/podlike/dockerregistryauth.json
|
|
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
|
|
|
|
secrets:
|
|
dockerregistryauth:
|
|
name: dockerregistryauth
|
|
external: true
|
|
|
|
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
|