2022-07-14 16:44:45 +01:00
|
|
|
# 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
|
2022-09-04 17:39:57 +01:00
|
|
|
REDIS_PASSWORD: "${REDIS_PASSWORD:-null}"
|
2022-07-14 16:44:45 +01:00
|
|
|
DB_CONNECTION: mongodb
|
|
|
|
DB_HOST: mongodb
|
|
|
|
DB_DATABASE: jikan
|
|
|
|
DB_PORT: 27017
|
|
|
|
DB_ADMIN: jikan
|
2022-09-04 17:39:57 +01:00
|
|
|
DB_USERNAME: "${DB_USERNAME}"
|
|
|
|
DB_PASSWORD: "${DB_PASSWORD}"
|
2022-07-14 16:44:45 +01:00
|
|
|
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:
|
2022-09-04 16:23:13 +01:00
|
|
|
test: [ 'CMD-SHELL', 'wget --spider -q "http://127.0.0.1:2114/health?plugin=http"' ]
|
2022-07-14 16:44:45 +01:00
|
|
|
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
|
2022-09-04 17:39:57 +01:00
|
|
|
environment:
|
|
|
|
MONGO_INITDB_ROOT_USERNAME: "${DB_USERNAME:-root}"
|
|
|
|
MONGO_INITDB_ROOT_PASSWORD: "${DB_PASSWORD}"
|
2022-07-14 16:44:45 +01:00
|
|
|
healthcheck:
|
|
|
|
test: echo 'db.runCommand("ping").ok' | mongo mongodb://localhost:27017 --quiet
|
|
|
|
interval: 30s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 5
|
|
|
|
|
|
|
|
redis:
|
|
|
|
image: redis:7-alpine
|
2022-09-04 17:39:57 +01:00
|
|
|
command:
|
|
|
|
- /bin/sh
|
|
|
|
- -c
|
|
|
|
- redis-server --requirepass "$${REDIS_PASSWORD:?REDIS_PASSWORD variable is not set}"
|
2022-07-14 16:44:45 +01:00
|
|
|
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
|
2022-09-04 17:39:57 +01:00
|
|
|
entrypoint: /bin/sh
|
|
|
|
command:
|
|
|
|
- -c
|
|
|
|
- /opt/typesense-server --data-dir /data --api-key "$${TYPESENSE_API_KEY:?TYPESENSE_API_KEY variable is not set}"
|
2022-07-14 16:44:45 +01:00
|
|
|
restart: no
|
|
|
|
volumes:
|
|
|
|
- typesense-data:/data
|
|
|
|
ports:
|
|
|
|
- "8108/tcp"
|