Build profile-gated services so workers do not run stale images.

The build step omitted COMPOSE_PROFILES, so docker compose skipped the
dj-queue worker and up -d reused an image from an earlier deploy; the
monica_site beta worker kept psycopg2 and crash-looped on LISTEN/NOTIFY.
This commit is contained in:
2026-08-09 06:23:17 -05:00
parent 9a0cbf80d9
commit 853eff020d
+3
View File
@@ -65,6 +65,8 @@
group: "{{ admin_user }}" group: "{{ admin_user }}"
mode: "0600" mode: "0600"
# COMPOSE_PROFILES must match the start step below: without it, profile-gated
# services (e.g. the dj-queue worker) are skipped here and keep a stale image.
- name: "django[{{ _project }}] build images" - name: "django[{{ _project }}] build images"
ansible.builtin.command: ansible.builtin.command:
cmd: "docker compose -f {{ _spec.compose_file }} --env-file .env build" cmd: "docker compose -f {{ _spec.compose_file }} --env-file .env build"
@@ -72,6 +74,7 @@
environment: environment:
COMPOSE_PROJECT_NAME: "{{ _project }}" COMPOSE_PROJECT_NAME: "{{ _project }}"
WEB_PORT: "{{ app_item.port }}" WEB_PORT: "{{ app_item.port }}"
COMPOSE_PROFILES: "{{ (app_item.compose_profiles | default([])) | join(',') }}"
become: true become: true
become_user: "{{ admin_user }}" become_user: "{{ admin_user }}"
changed_when: true changed_when: true