put env vars in docker_stack compose
Some checks failed
fp/our CI/CD / build (push) Successful in 3m0s
ci / test (push) Failing after 5m32s

This commit is contained in:
CJ_Clippy 2025-10-06 01:31:03 -08:00
parent bf53429e0f
commit 144a460ed5
4 changed files with 24 additions and 8 deletions

View File

@ -3,6 +3,13 @@
ansible.builtin.set_fact:
our_vfs_mount_tag: "{{ lookup('dotenv', 'VULTR_VFS_MOUNT_TAG', file='../../../../.env.production') }}"
- name: Check if /mnt/vfs is already mounted
ansible.builtin.command: findmnt -n /mnt/vfs
register: our_vfs_mounted
ignore_errors: true
changed_when: false
# there's a bug. we dont want to run this unless needed. https://gitlab.com/virtio-fs/virtiofsd/-/issues/213
- name: Mount VFS
ansible.posix.mount:
src: "{{ our_vfs_mount_tag }}"
@ -10,3 +17,4 @@
fstype: virtiofs
opts: defaults,_netdev
state: mounted
when: our_vfs_mounted.rc != 0

View File

@ -0,0 +1,4 @@
---
# router.yml
# here we make changes to the load balancer app routing

View File

@ -5,11 +5,11 @@
state: directory
mode: "0755"
- name: Copy env file
ansible.builtin.copy:
src: ../../../../.env.production
dest: /etc/futureporn/our/.env
mode: "0600"
# - name: Copy env file
# ansible.builtin.copy:
# src: ../../../../.env.production
# dest: /etc/futureporn/our/.env
# mode: "0600"
- name: Clone the latest code
ansible.builtin.git:
@ -46,6 +46,13 @@
compose:
- /etc/futureporn/our/compose.production.yaml
- /etc/futureporn/our/compose.green.yaml
- services:
worker:
environment:
DATABASE_URL: "{{ lookup('dotenv', 'DATABASE_URL', file='../../../../.env.production') }}"
server:
environment:
DATABASE_URL: "{{ lookup('dotenv', 'DATABASE_URL', file='../../../../.env.production') }}"
- name: Deploy stack to blue
community.docker.docker_stack:

View File

@ -1,7 +1,6 @@
services:
server:
image: gitea.futureporn.net/futureporn/our:latest
env_file: ./.env
depends_on:
- postgres
init: true
@ -13,7 +12,6 @@ services:
worker:
image: gitea.futureporn.net/futureporn/our:latest
env_file: ./.env
depends_on:
- postgres
init: true
@ -38,7 +36,6 @@ services:
qbittorrent:
image: gitea.futureporn.net/futureporn/qbittorrent-nox:latest
env_file: ./.env
init: false
volumes:
- /mnt/vfs/futureporn:/mnt/vfs/futureporn