Created
December 14, 2024 02:47
-
-
Save phunguyen19/3f480659ffb2bcfddd4a4a29abc0b497 to your computer and use it in GitHub Desktop.
Local Docker Compose
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.8' | |
services: | |
mysql: | |
image: mysql | |
environment: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: localdocker | |
MYSQL_USER: user | |
MYSQL_PASSWORD: pass | |
ports: | |
- "3306:3306" # Map the MySQL port to localhost | |
volumes: | |
- ./mysql_data:/var/lib/mysql | |
postgres: | |
image: postgres | |
environment: | |
POSTGRES_USER: root | |
POSTGRES_PASSWORD: root | |
POSTGRES_DB: postgres | |
ports: | |
- "5432:5432" # Map the PostgreSQL port to localhost | |
volumes: | |
- ./postgres_data:/var/lib/postgresql/data | |
adminer: | |
image: adminer:latest | |
restart: always | |
ports: | |
- "8080:8080" # Map Adminer to localhost | |
depends_on: | |
- mysql | |
volumes: | |
mysql_data: | |
postgres_data: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment