combine into one compose
This commit is contained in:
parent
bf44851e85
commit
6bc5f182f3
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
- name: Add a docker network
|
- name: Add a docker network
|
||||||
community.docker.docker_network:
|
community.docker.docker_network:
|
||||||
name: spooky
|
name: our
|
||||||
scope: swarm
|
scope: swarm
|
||||||
state: present
|
state: present
|
||||||
driver: overlay
|
driver: overlay
|
||||||
@ -28,32 +28,20 @@
|
|||||||
dest: "/etc/futureporn/our/{{ item }}"
|
dest: "/etc/futureporn/our/{{ item }}"
|
||||||
mode: "0744"
|
mode: "0744"
|
||||||
loop:
|
loop:
|
||||||
- compose.db.yaml
|
|
||||||
- compose.production.yaml
|
- compose.production.yaml
|
||||||
- compose.green.yaml
|
|
||||||
- compose.blue.yaml
|
|
||||||
|
|
||||||
- name: Deploy db stack
|
- name: Deploy stack
|
||||||
community.docker.docker_stack:
|
community.docker.docker_stack:
|
||||||
state: present
|
state: present
|
||||||
name: our-postgres
|
name: our
|
||||||
compose:
|
compose:
|
||||||
- /etc/futureporn/our/compose.db.yaml
|
- /etc/futureporn/our/compose.production.yaml
|
||||||
- services:
|
- services:
|
||||||
postgres:
|
postgres:
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: "{{ lookup('dotenv', 'POSTGRES_USER', file='../../../../.env.production') }}"
|
POSTGRES_USER: "{{ lookup('dotenv', 'POSTGRES_USER', file='../../../../.env.production') }}"
|
||||||
POSTGRES_PASSWORD: "{{ lookup('dotenv', 'POSTGRES_PASSWORD', file='../../../../.env.production') }}"
|
POSTGRES_PASSWORD: "{{ lookup('dotenv', 'POSTGRES_PASSWORD', file='../../../../.env.production') }}"
|
||||||
POSTGRES_DB: "{{ lookup('dotenv', 'POSTGRES_DB', file='../../../../.env.production') }}"
|
POSTGRES_DB: "{{ lookup('dotenv', 'POSTGRES_DB', file='../../../../.env.production') }}"
|
||||||
|
|
||||||
- name: Deploy stack to green
|
|
||||||
community.docker.docker_stack:
|
|
||||||
state: present
|
|
||||||
name: our-green
|
|
||||||
compose:
|
|
||||||
- /etc/futureporn/our/compose.production.yaml
|
|
||||||
- /etc/futureporn/our/compose.green.yaml
|
|
||||||
- services:
|
|
||||||
worker:
|
worker:
|
||||||
environment:
|
environment:
|
||||||
DATABASE_URL: "{{ lookup('dotenv', 'DATABASE_URL', file='../../../../.env.production') }}"
|
DATABASE_URL: "{{ lookup('dotenv', 'DATABASE_URL', file='../../../../.env.production') }}"
|
||||||
@ -78,19 +66,27 @@
|
|||||||
SEEDBOX_SFTP_URL: "{{ lookup('dotenv', 'SEEDBOX_SFTP_URL', file='../../../../.env.production') }}"
|
SEEDBOX_SFTP_URL: "{{ lookup('dotenv', 'SEEDBOX_SFTP_URL', file='../../../../.env.production') }}"
|
||||||
SEEDBOX_SFTP_USERNAME: "{{ lookup('dotenv', 'SEEDBOX_SFTP_USERNAME', file='../../../../.env.production') }}"
|
SEEDBOX_SFTP_USERNAME: "{{ lookup('dotenv', 'SEEDBOX_SFTP_USERNAME', file='../../../../.env.production') }}"
|
||||||
SEEDBOX_SFTP_PASSWORD: "{{ lookup('dotenv', 'SEEDBOX_SFTP_PASSWORD', file='../../../../.env.production') }}"
|
SEEDBOX_SFTP_PASSWORD: "{{ lookup('dotenv', 'SEEDBOX_SFTP_PASSWORD', file='../../../../.env.production') }}"
|
||||||
|
|
||||||
server:
|
server:
|
||||||
environment:
|
environment:
|
||||||
DATABASE_URL: "{{ lookup('dotenv', 'DATABASE_URL', file='../../../../.env.production') }}"
|
DATABASE_URL: "{{ lookup('dotenv', 'DATABASE_URL', file='../../../../.env.production') }}"
|
||||||
|
NODE_ENV: "{{ lookup('dotenv', 'NODE_ENV', file='../../../../.env.production') }}"
|
||||||
- name: Deploy stack to blue
|
ORIGIN: "{{ lookup('dotenv', 'ORIGIN', file='../../../../.env.production') }}"
|
||||||
community.docker.docker_stack:
|
PATREON_API_ORIGIN: "{{ lookup('dotenv', 'PATREON_API_ORIGIN', file='../../../../.env.production') }}"
|
||||||
state: present
|
PATREON_AUTHORIZE_PATH: "{{ lookup('dotenv', 'PATREON_AUTHORIZE_PATH', file='../../../../.env.production') }}"
|
||||||
name: our-blue
|
PATREON_TOKEN_PATH: "{{ lookup('dotenv', 'PATREON_TOKEN_PATH', file='../../../../.env.production') }}"
|
||||||
compose:
|
PATREON_CLIENT_ID: "{{ lookup('dotenv', 'PATREON_CLIENT_ID', file='../../../../.env.production') }}"
|
||||||
- /etc/futureporn/our/compose.production.yaml
|
PATREON_CLIENT_SECRET: "{{ lookup('dotenv', 'PATREON_CLIENT_SECRET', file='../../../../.env.production') }}"
|
||||||
- /etc/futureporn/our/compose.blue.yaml
|
COOKIE_SECRET: "{{ lookup('dotenv', 'COOKIE_SECRET', file='../../../../.env.production') }}"
|
||||||
# - name: Remove stack
|
S3_REGION: "{{ lookup('dotenv', 'S3_REGION', file='../../../../.env.production') }}"
|
||||||
# community.docker.docker_stack:
|
S3_BUCKET: "{{ lookup('dotenv', 'S3_BUCKET', file='../../../../.env.production') }}"
|
||||||
# name: mystack
|
S3_APPLICATION_KEY: "{{ lookup('dotenv', 'S3_APPLICATION_KEY', file='../../../../.env.production') }}"
|
||||||
# state: absent
|
S3_KEY_ID: "{{ lookup('dotenv', 'S3_KEY_ID', file='../../../../.env.production') }}"
|
||||||
|
S3_ENDPOINT: "{{ lookup('dotenv', 'S3_ENDPOINT', file='../../../../.env.production') }}"
|
||||||
|
CDN_ORIGIN: "{{ lookup('dotenv', 'CDN_ORIGIN', file='../../../../.env.production') }}"
|
||||||
|
CDN_TOKEN_SECRET: "{{ lookup('dotenv', 'CDN_TOKEN_SECRET', file='../../../../.env.production') }}"
|
||||||
|
WHISPER_DIR: "{{ lookup('dotenv', 'WHISPER_DIR', file='../../../../.env.production') }}"
|
||||||
|
B2_APPLICATION_KEY_ID: "{{ lookup('dotenv', 'B2_APPLICATION_KEY_ID', file='../../../../.env.production') }}"
|
||||||
|
B2_APPLICATION_KEY: "{{ lookup('dotenv', 'B2_APPLICATION_KEY', file='../../../../.env.production') }}"
|
||||||
|
SEEDBOX_SFTP_URL: "{{ lookup('dotenv', 'SEEDBOX_SFTP_URL', file='../../../../.env.production') }}"
|
||||||
|
SEEDBOX_SFTP_USERNAME: "{{ lookup('dotenv', 'SEEDBOX_SFTP_USERNAME', file='../../../../.env.production') }}"
|
||||||
|
SEEDBOX_SFTP_PASSWORD: "{{ lookup('dotenv', 'SEEDBOX_SFTP_PASSWORD', file='../../../../.env.production') }}"
|
||||||
|
@ -7,27 +7,6 @@ services:
|
|||||||
# protocol: tcp
|
# protocol: tcp
|
||||||
# mode: ingress
|
# mode: ingress
|
||||||
|
|
||||||
postgres:
|
|
||||||
image: postgres:17
|
|
||||||
volumes:
|
|
||||||
- pgdata:/var/lib/postgresql/data
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "pg_isready", "-U", "postgres"]
|
|
||||||
interval: 10s
|
|
||||||
retries: 5
|
|
||||||
start_period: 10s
|
|
||||||
timeout: 10s
|
|
||||||
deploy:
|
|
||||||
replicas: 1
|
|
||||||
restart_policy:
|
|
||||||
condition: on-failure
|
|
||||||
delay: 5s
|
|
||||||
max_attempts: 5
|
|
||||||
window: 60s
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
pgdata:
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
external: true
|
external: true
|
||||||
|
@ -6,7 +6,11 @@ services:
|
|||||||
sh -c "npx prisma migrate deploy && npm run start:server"
|
sh -c "npx prisma migrate deploy && npm run start:server"
|
||||||
volumes:
|
volumes:
|
||||||
- /mnt/vfs/futureporn:/mnt/vfs/futureporn
|
- /mnt/vfs/futureporn:/mnt/vfs/futureporn
|
||||||
# blue/green ports get published in those respective compose fragments
|
ports:
|
||||||
|
- target: 5000 # container port
|
||||||
|
published: 8086 # Swarm ingress port
|
||||||
|
protocol: tcp
|
||||||
|
mode: ingress
|
||||||
|
|
||||||
worker:
|
worker:
|
||||||
image: gitea.futureporn.net/futureporn/our:latest
|
image: gitea.futureporn.net/futureporn/our:latest
|
||||||
@ -36,7 +40,36 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- /mnt/vfs/futureporn:/mnt/vfs/futureporn
|
- /mnt/vfs/futureporn:/mnt/vfs/futureporn
|
||||||
|
|
||||||
|
postgres:
|
||||||
|
image: postgres:17
|
||||||
|
volumes:
|
||||||
|
- pgdata:/var/lib/postgresql/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "pg_isready", "-U", "postgres"]
|
||||||
|
interval: 10s
|
||||||
|
retries: 5
|
||||||
|
start_period: 10s
|
||||||
|
timeout: 10s
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
delay: 5s
|
||||||
|
max_attempts: 5
|
||||||
|
window: 60s
|
||||||
|
|
||||||
|
# pgadmin:
|
||||||
|
# image: dpage/pgadmin4:latest
|
||||||
|
# ports:
|
||||||
|
# - target: 5050
|
||||||
|
# published: 8095
|
||||||
|
# protocol: tcp
|
||||||
|
# mode: ingress
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
pgdata:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
external: true
|
external: true
|
||||||
name: spooky
|
name: our
|
||||||
|
Loading…
x
Reference in New Issue
Block a user