diff --git a/.docker/docker-compose.yml b/.docker/docker-compose.yml index 31884d6..d1faef5 100644 --- a/.docker/docker-compose.yml +++ b/.docker/docker-compose.yml @@ -1,5 +1,19 @@ version: '3' services: + db: + container_name: moneymong-db + image: mysql + environment: + MYSQL_DATABASE: moneymong + MYSQL_USERNAME: root + MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD_DEV} + TZ: Asia/Seoul + ports: + - ${DOCKER_DB_PORT} + volumes: + - ./mysqldata:/var/lib/mysql + restart: always + server: container_name: server image: ${DOCKER_IMAGE_NAME} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 41930c4..f0f838d 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -29,7 +29,7 @@ spring: datasource: db: pool-name: moneymong - jdbc-url: jdbc:mysql://localhost:3306/moneymong?useSSL=false&&allowPublicKeyRetrieval=true + jdbc-url: jdbc:mysql://moneymong-db:3306/moneymong?useSSL=false&&allowPublicKeyRetrieval=true username: root password: ${DB_ROOT_PASSWORD_DEV} driver-class-name: com.mysql.cj.jdbc.Driver