Skip to content
Snippets Groups Projects
Commit 719b30e3 authored by fz2907's avatar fz2907
Browse files

added docker-compose.yml to create the database

parent c02fafd4
No related branches found
No related tags found
3 merge requests!27Sprint 1 done,!7Changed DB port from 3306 to 3307. So it will not interrupt with your own local MySQL,!6Service to DB connection is ready.
/.idea/
/DataBaseFolder/MySQL/mySQL-Data/
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="2f445186-863f-4ba0-a69b-1197a12a9418" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/FrontendFolder/switch-room/src/services/Constants.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/FrontendFolder/switch-room/src/services/ExampleService.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/compiler.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/gradle.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/jarRepositories.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" />
<list default="true" id="af5ba6fa-a4b6-4030-a5d4-1a5d3d23a59d" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/DataBaseFolder/MySQL/docker-compose.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ScriptFolder/StartServiceScript.sh" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/BackendFolder/SwitchRoom/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/BackendFolder/SwitchRoom/build.gradle" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ExternalProjectsData">
<projectState path="$PROJECT_DIR$/BackendFolder/SwitchRoom">
<ProjectState />
</projectState>
</component>
<component name="ExternalProjectsManager">
<system id="GRADLE">
<state>
<projects_view>
<tree_state>
<expand />
<select />
</tree_state>
</projects_view>
</state>
</system>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectId" id="2G5usFtgI8bz2hXPNccYRLa4daI" />
<component name="ProjectId" id="2G9XDL8qX22nraCZnaiCAVotZtz" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
......@@ -34,14 +51,29 @@
"last_opened_file_path": "D:/Code"
}
}]]></component>
<component name="RunManager">
<configuration name="MySQL: Compose Deployment" type="docker-deploy" factoryName="docker-compose.yml" temporary="true" server-name="Docker">
<deployment type="docker-compose.yml">
<settings>
<option name="sourceFilePath" value="DataBaseFolder/MySQL/docker-compose.yml" />
</settings>
</deployment>
<method v="2" />
</configuration>
<recent_temporary>
<list>
<item itemvalue="Docker.MySQL: Compose Deployment" />
</list>
</recent_temporary>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="2f445186-863f-4ba0-a69b-1197a12a9418" name="Changes" comment="" />
<created>1665690971852</created>
<changelist id="af5ba6fa-a4b6-4030-a5d4-1a5d3d23a59d" name="Changes" comment="" />
<created>1665801654687</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1665690971852</updated>
<updated>1665801654687</updated>
</task>
<servers />
</component>
......
......@@ -19,7 +19,8 @@ repositories {
}
dependencies {
// implementation 'org.springframework.boot:spring-boot-starter-data-jdbc'
//implementation 'org.springframework.boot:spring-boot-starter-data-jdbc'
//implementation 'mysql:mysql-connector-java:8.0.30'
// implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
// implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation 'org.springframework.boot:spring-boot-starter-web'
......
version: '3.8'
services:
db:
image: mysql:latest # use latest version of mysql
container_name: db # add a name for the container
command: --default-authentication-plugin=mysql_native_password
restart: always
environment: # add default values, see docs for more info.
MYSQL_USER: user
MYSQL_ROOT_PASSWORD: mypassword
MYSQL_PASSWORD: mypassword
MYSQL_DATABASE: switch-room-db # create this database on startup
volumes:
- my-db:/var/lib/mysql
ports:
- '3306:3306'
volumes: # add persistent data even if container is removed.
my-db:
\ No newline at end of file
#function to start VUE
startVUE(){
echo "Starting VUE service..."
# shellcheck disable=SC2164
cd ../FrontendFolder/switch-room
npm run serve
}
#function to start DB
startDB(){
echo "Starting DB service..."
# shellcheck disable=SC2164
cd ../DataBaseFolder/MySQL
docker-compose up
}
startDB
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment