diff --git a/.env.example b/.env.example index 075584f..1da8948 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ -MYSQL_DB_HOST=localhost -MYSQL_DB_PORT=3310 -MYSQL_DB_USER=root -MYSQL_DB_PASSWORD=root \ No newline at end of file +APP_PORT_BACKEND=8888 +MYSQL_DB_HOST=db +MYSQL_DB_PORT=3311 +MYSQL_DB_UNAME=root +MYSQL_DB_PASSWD=root \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 897ba6f..076c7e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # # Twitter Backend - Moo: Twitter Clone Application Backend by Scaler -# Copyright © 2021 Subhrodip Mohanta (hello@subho.xyz) +# Copyright © 2021-2023 Subhrodip Mohanta (hello@subho.xyz) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/README.md b/README.md index 5ccb0c9..5636965 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,11 @@ Install the project dependencies: ```shell mvn install ``` - +Load the `.env` file: +```shell +cp .env.example .env +source .env +``` Update the application.properties file to configure the database connection details: ```shell diff --git a/docker-compose.yml b/docker-compose.yml index 05b57e1..d0edf59 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ # # Twitter Backend - Moo: Twitter Clone Application Backend by Scaler -# Copyright © 2021 Subhrodip Mohanta (hello@subho.xyz) +# Copyright © 2021-2023 Subhrodip Mohanta (hello@subho.xyz) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -22,11 +22,13 @@ services: db: image: mysql:8 + container_name: db volumes: - db_data:/var/lib/mysql restart: always + hostname: db ports: - - "3310:3306" + - "${MYSQL_DB_PORT}:3306" environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: twitter @@ -36,17 +38,18 @@ services: twitter-backend: depends_on: - db + container_name: twitter-backend build: context: . dockerfile: Dockerfile ports: - - "8080:8080" + - "${APP_PORT_BACKEND}:8080" restart: always environment: - MYSQL_DB_HOST: db - MYSQL_DB_PORT: 3306 - MYSQL_DB_UNAME: root - MYSQL_DB_PASSWD: root + MYSQL_DB_HOST: ${MYSQL_DB_HOST} + MYSQL_DB_PORT: ${MYSQL_DB_PORT} + MYSQL_DB_UNAME: ${MYSQL_DB_UNAME} + MYSQL_DB_PASSWD: ${MYSQL_DB_PASSWD} volumes: db_data: {} diff --git a/etc/license-plugin-header-style.xml b/etc/license-plugin-header-style.xml index 62a4e0b..543acd9 100644 --- a/etc/license-plugin-header-style.xml +++ b/etc/license-plugin-header-style.xml @@ -2,7 +2,7 @@