2025-07-11 23:07:32 -04:00

48 lines
1.8 KiB
YAML

- name: Create postiz db
ansible.builtin.include_role:
role: app/database
vars:
app_name: "{{ postiz_db_name }}"
- name: Container data on NAS
ansible.builtin.include_role:
role: docker/container-data
vars:
dir_name: "{{ postiz_instance_name }}"
- name: Create needed subdirectories
ansible.builtin.file:
dest: "{{ container_data_base_path }}/{{postiz_instance_name}}/{{ item }}"
state: directory
mode: '0777'
loop:
- config
- uploads
- name: Deploy postiz container
community.docker.docker_container:
name: "{{ postiz_instance_name }}"
image: ghcr.io/gitroomhq/postiz-app:latest
restart_policy: always
env:
MAIN_URL: "{{ url }}"
FRONTEND_URL: "{{ url }}"
NEXT_PUBLIC_BACKEND_URL: "{{ url }}/api"
JWT_SECRET: "{{ jwt_secret }}"
# These defaults are probably fine, but if you change your user/password, update it in the
# postiz-postgres or postiz-redis services below.
DATABASE_URL: "postgresql://{{ postiz_db_name }}:{{ postiz_db_name }}@password:5432/{{ postiz_db_name }}"
REDIS_URL: "redis://{{ lookup('hostip', 'prod_services') }}:6379"
BACKEND_INTERNAL_URL: "http://localhost:3000"
IS_GENERAL: "true" # Required for self-hosting.
DISABLE_REGISTRATION: "false" # Only allow single registration, then disable signup
# The container images are pre-configured to use /uploads for file storage.
# You probably should not change this unless you have a really good reason!
STORAGE_PROVIDER: "local"
UPLOAD_DIRECTORY: "/uploads"
NEXT_PUBLIC_UPLOAD_DIRECTORY: "/uploads"
volumes:
- "{{ container_data_base_path }}/config:/config/"
- "{{ container_data_base_path }}/uploads:/uploads/"
ports:
- "{{ port }}:5000"