# For now this is just for local development. This is not production ready. version: '3.8' volumes: mongo-data: {} redis-data: {} tmp-data: {} typesense-data: {} services: jikan_rest: &jikan_rest build: context: . dockerfile: Dockerfile user: "${APP_UID:-10001}:${APP_GID:-10001}" environment: PS1: '\[\033[1;32m\]\[\033[1;36m\][\u@\h] \[\033[1;34m\]\w\[\033[0;35m\] \[\033[1;36m\]# \[\033[0m\]' HOME: /tmp APP_DEBUG: 'true' APP_ENV: local REDIS_HOST: redis REDIS_PASSWORD: "${REDIS_PASSWORD:-null}" DB_CONNECTION: mongodb DB_HOST: mongodb DB_DATABASE: jikan DB_PORT: 27017 DB_ADMIN: jikan DB_USERNAME: "${DB_USERNAME}" DB_PASSWORD: "${DB_PASSWORD}" volumes: - /etc/passwd:/etc/passwd:ro - /etc/group:/etc/group:ro - tmp-data:/tmp:rw - .:/app:rw depends_on: mongodb: {condition: service_healthy} redis: {condition: service_healthy} typesense: {condition: service_healthy} web: <<: *jikan_rest ports: - '8080:8080/tcp' healthcheck: test: [ 'CMD-SHELL', 'wget --spider -q "http://127.0.0.1:2114/health?plugin=http"' ] interval: 2s timeout: 2s cron: <<: *jikan_rest command: supercronic /etc/supercronic/laravel # it runs artisan schedule:run mongodb: image: mongo:focal volumes: - mongo-data:/data/db ports: - '27017/tcp' command: --wiredTigerCacheSizeGB 1 environment: MONGO_INITDB_ROOT_USERNAME: "${DB_USERNAME:-root}" MONGO_INITDB_ROOT_PASSWORD: "${DB_PASSWORD}" healthcheck: test: echo 'db.runCommand("ping").ok' | mongo mongodb://localhost:27017 --quiet interval: 30s timeout: 10s retries: 5 redis: image: redis:7-alpine command: - /bin/sh - -c - redis-server --requirepass "$${REDIS_PASSWORD:?REDIS_PASSWORD variable is not set}" volumes: - redis-data:/data:rw ports: - '6379/tcp' healthcheck: test: [ 'CMD', 'redis-cli', 'ping' ] interval: 500ms timeout: 1s typesense: image: typesense/typesense:0.23.1 entrypoint: /bin/sh command: - -c - /opt/typesense-server --data-dir /data --api-key "$${TYPESENSE_API_KEY:?TYPESENSE_API_KEY variable is not set}" restart: no volumes: - typesense-data:/data ports: - "8108/tcp"