Last active
August 30, 2022 19:01
-
-
Save insolor/2c6b7c5b859ff8fe89b39ded4fa539bd to your computer and use it in GitHub Desktop.
Custom docker-compose.yml for fastapi-admin demo, which runs mysql and redis along with the fastapi-admin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
db: | |
image: mysql:latest | |
environment: | |
MYSQL_DATABASE: 'fastapi-admin' | |
MYSQL_ROOT_PASSWORD: '123456' | |
ports: | |
- '3306:3306' | |
volumes: | |
- my-db:/var/lib/mysql | |
redis: | |
image: "redis:alpine" | |
command: redis-server | |
ports: | |
- "6379:6379" | |
volumes: | |
- redis-data:/var/lib/redis | |
environment: | |
- REDIS_REPLICATION_MODE=master | |
app: | |
environment: | |
- DATABASE_URL=mysql://root:[email protected]:3306/fastapi-admin | |
- REDIS_URL=redis://localhost:6379/0 | |
build: . | |
restart: always | |
# env_file: .env | |
network_mode: host | |
image: fastapi-admin | |
command: uvicorn examples.main:app_ --port 8000 --host 0.0.0.0 | |
depends_on: | |
- db | |
- redis | |
volumes: | |
my-db: | |
redis-data: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment