# ansible playbook to set up some docker containers - name: Set up a dev node hosts: dev gather_facts: true tasks: - name: Create network community.docker.docker_network: name: oasst state: present driver: bridge - name: Copy redis.conf to managed node ansible.builtin.copy: src: ./redis.conf dest: ./redis.conf - name: Set up Redis community.docker.docker_container: name: oasst-redis image: redis state: started restart_policy: always network_mode: oasst ports: - 6379:6379 healthcheck: test: ["CMD-SHELL", "redis-cli ping | grep PONG"] interval: 2s timeout: 2s retries: 10 command: redis-server /usr/local/etc/redis/redis.conf volumes: - "./redis.conf:/usr/local/etc/redis/redis.conf" - name: Set up Redis Insights community.docker.docker_container: name: oasst-redis-insights image: redislabs/redisinsight:latest state: started restart_policy: always network_mode: oasst ports: - 8001:8001 - name: Create postgres containers community.docker.docker_container: name: "{{ item.name }}" image: postgres:15 state: started restart_policy: always network_mode: oasst env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: postgres volumes: - "{{ item.name }}:/var/lib/postgresql/data" healthcheck: test: ["CMD", "pg_isready", "-U", "postgres"] interval: 2s timeout: 2s retries: 10 loop: - name: oasst-postgres - name: oasst-postgres-web - name: Run the oasst oasst-backend community.docker.docker_container: name: oasst-backend image: ghcr.io/laion-ai/open-assistant/oasst-backend state: started recreate: true pull: true restart_policy: always network_mode: oasst env: POSTGRES_HOST: oasst-postgres REDIS_HOST: oasst-redis DEBUG_ALLOW_ANY_API_KEY: "true" DEBUG_USE_SEED_DATA: "true" DEBUG_ALLOW_SELF_LABELING: "true" MAX_WORKERS: "1" RATE_LIMIT: "false" DEBUG_SKIP_EMBEDDING_COMPUTATION: "true" ports: - 8080:8080 - name: Run the oasst oasst-web frontend community.docker.docker_container: name: oasst-web image: ghcr.io/laion-ai/open-assistant/oasst-web state: started recreate: true pull: true restart_policy: always network_mode: oasst env: ADMIN_USERS: "{{ lookup('ansible.builtin.env', 'WEB_ADMIN_USERS') }}" DATABASE_URL: postgres://postgres:postgres@oasst-postgres-web/postgres DEBUG_LOGIN: "true" DISCORD_CLIENT_ID: "{{ lookup('ansible.builtin.env', 'WEB_DISCORD_CLIENT_ID') }}" DISCORD_CLIENT_SECRET: "{{ lookup('ansible.builtin.env', 'WEB_DISCORD_CLIENT_SECRET') }}" EMAIL_FROM: open-assistent@laion.ai EMAIL_SERVER_HOST: "{{ lookup('ansible.builtin.env', 'WEB_EMAIL_SERVER_HOST') }}" EMAIL_SERVER_PASSWORD: "{{ lookup('ansible.builtin.env', 'WEB_EMAIL_SERVER_PASSWORD') }}" EMAIL_SERVER_PORT: "{{ lookup('ansible.builtin.env', 'WEB_EMAIL_SERVER_PORT') }}" EMAIL_SERVER_USER: "{{ lookup('ansible.builtin.env', 'WEB_EMAIL_SERVER_USER') }}" FASTAPI_URL: http://oasst-backend:8080 FASTAPI_KEY: "1234" NEXTAUTH_SECRET: "{{ lookup('ansible.builtin.env', 'WEB_NEXTAUTH_SECRET') }}" NEXTAUTH_URL: http://web.dev.open-assistant.io/ ports: - 3000:3000 command: bash wait-for-postgres.sh node server.js