INC-1 change db,work dockerfile and docker-compose.yaml
This commit is contained in:
+30
-41
@@ -1,52 +1,41 @@
|
||||
version: "3.8"
|
||||
version: '3.9'
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:8.1
|
||||
container_name: no-copy-mysql-db
|
||||
db:
|
||||
image: postgres:17
|
||||
restart: always
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root_pass
|
||||
MYSQL_DATABASE: no-copy-db
|
||||
MYSQL_USER: mysql_user
|
||||
MYSQL_PASSWORD: mysql_pass
|
||||
POSTGRES_DB: no_copy_db
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_PORT: 5432
|
||||
POSTGRES_HOST: postgres
|
||||
PGDATA: /data/postgres
|
||||
ports:
|
||||
- "3306:3306"
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- mysql_data:/var/lib/mysql
|
||||
networks:
|
||||
- app-network
|
||||
command: --default-authentication-plugin=mysql_native_password
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "pg_isready -U postgres -p 5432" ]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 20
|
||||
container_name: postgres
|
||||
|
||||
redis:
|
||||
image: redis:7
|
||||
container_name: no-copy-redis
|
||||
ports:
|
||||
- "6379:6379"
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
no-copy:
|
||||
app:
|
||||
build: .
|
||||
container_name: no-copy-service
|
||||
container_name: no_copy_app
|
||||
environment:
|
||||
POSTGRES_DB: no_copy_db
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_PORT: 5432
|
||||
POSTGRES_HOST: postgres
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
DB_HOST: mysql
|
||||
DB_PORT: 3306
|
||||
DB_NAME: no-copy-db
|
||||
DB_USERNAME: mysql_user
|
||||
DB_PASSWORD: mysql_pass
|
||||
SERVER_PORT: 8080
|
||||
REDIS_HOST: redis
|
||||
REDIS_PORT: 6379
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
volumes:
|
||||
mysql_data:
|
||||
|
||||
networks:
|
||||
app-network:
|
||||
pgdata:
|
||||
|
||||
Reference in New Issue
Block a user