wipe: Fix reusing of same volume accross differnt instances

This commit is contained in:
Kacper Donat 2023-02-12 15:59:27 +01:00
parent 26cb43e07c
commit a832e95730

View File

@ -25,31 +25,31 @@ services:
pod.component.fpm: | pod.component.fpm: |
image: registry.kadet.net/wipe/php-fpm:{{ wipe_version }} image: registry.kadet.net/wipe/php-fpm:{{ wipe_version }}
volumes: volumes:
- www-data:/var/www - {{ service }}-www-data:/var/www
- storage-data:/var/www/storage - {{ service }}-storage-data:/var/www/storage
pod.component.nginx: | pod.component.nginx: |
image: nginx:latest image: nginx:latest
volumes: volumes:
- www-data:/var/www - {{ service }}-www-data:/var/www
- storage-data:/var/www/storage - {{ service }}-storage-data:/var/www/storage
- nginx-config:/etc/nginx/templates - {{ service }}-nginx-config:/etc/nginx/templates
pod.copy.fpm: /var/conf/wipe/.env:/var/www/.env pod.copy.fpm: /var/conf/wipe/.env:/var/www/.env
pod.init.components: | pod.init.components: |
- image: registry.kadet.net/wipe/php-fpm:{{ wipe_version }} - image: registry.kadet.net/wipe/php-fpm:{{ wipe_version }}
entrypoint: ["/bin/sh", "-c"] entrypoint: ["/bin/sh", "-c"]
command: ["cp -r /var/www/* /mnt/www"] command: ["cp -r /var/www/* /mnt/www"]
volumes: volumes:
- www-data:/mnt/www - {{ service }}-www-data:/mnt/www
- image: registry.kadet.net/wipe/php-fpm:{{ wipe_version }} - image: registry.kadet.net/wipe/php-fpm:{{ wipe_version }}
entrypoint: ["/bin/sh", "-c"] entrypoint: ["/bin/sh", "-c"]
command: ["cp -rnp /var/www/storage/* /mnt/storage"] command: ["cp -rnp /var/www/storage/* /mnt/storage"]
volumes: volumes:
- storage-data:/mnt/storage - {{ service }}-storage-data:/mnt/storage
- image: registry.kadet.net/wipe/php-fpm:{{ wipe_version }} - image: registry.kadet.net/wipe/php-fpm:{{ wipe_version }}
entrypoint: ["/bin/sh", "-c"] entrypoint: ["/bin/sh", "-c"]
command: ["cp -r /var/www/nginx/* /mnt/config"] command: ["cp -r /var/www/nginx/* /mnt/config"]
volumes: volumes:
- nginx-config:/mnt/config - {{ service }}-nginx-config:/mnt/config
configs: configs:
- source: dotenv_{{ dotenv_file.checksum }} - source: dotenv_{{ dotenv_file.checksum }}
target: /var/conf/wipe/.env target: /var/conf/wipe/.env
@ -73,14 +73,13 @@ configs:
volumes: volumes:
nginx-config: nginx-config:
name: '{{ "nginx-config.{{.Task.ID}}" }}' name: '{{ service }}-{{ "nginx-config.{{.Task.ID}}" }}'
labels: labels:
com.github.rycus86.podlike.volume-ref: nginx-config com.github.rycus86.podlike.volume-ref: "{{ service }}-nginx-config"
www-data: www-data:
name: '{{ "www-data.{{.Task.ID}}" }}' name: '{{ service }}-{{ "www-data.{{.Task.ID}}" }}'
labels: labels:
com.github.rycus86.podlike.volume-ref: www-data com.github.rycus86.podlike.volume-ref: "{{ service }}-www-data"
storage-data: storage-data:
name: '{{ "www-data.{{.Task.ID}}" }}'
labels: labels:
com.github.rycus86.podlike.volume-ref: storage-data com.github.rycus86.podlike.volume-ref: "{{ service }}-storage-data"