-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from 9500073161/dev
Docker:V2
- Loading branch information
Showing
4 changed files
with
82 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
CREATE DATABASE IF NOT EXISTS `coursemanagement` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; | ||
USE `coursemanagement`; | ||
|
||
CREATE TABLE IF NOT EXISTS `courses` ( | ||
`id` int NOT NULL COMMENT 'Id', | ||
`name` varchar(255) NOT NULL COMMENT 'Name', | ||
`teacher_id` int NOT NULL COMMENT 'TeacherID', | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=`utf8`; | ||
|
||
CREATE TABLE IF NOT EXISTS `students` ( | ||
`id` int NOT NULL COMMENT 'Id', | ||
`name` varchar(255) NOT NULL COMMENT 'Name', | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=`utf8`; | ||
|
||
CREATE TABLE IF NOT EXISTS `teachers` ( | ||
`id` int NOT NULL COMMENT 'Id', | ||
`name` varchar(255) NOT NULL COMMENT 'Name', | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=`utf8`; | ||
|
||
CREATE TABLE IF NOT EXISTS `entrollments` ( | ||
`id` int NOT NULL COMMENT 'Id', | ||
`course_id` int NOT NULL COMMENT 'Courseid', | ||
`student_id` int NOT NULL COMMENT 'Studentid', | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=`utf8`; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: '3.8' | ||
|
||
services: | ||
app: | ||
build: . | ||
ports: | ||
- "8080:8080" | ||
depends_on: | ||
- db | ||
environment: | ||
- DB_HOST=db | ||
- DB_PORT=3306 | ||
- DB_USER=root | ||
- DB_PASSWORD=1234 | ||
- DB_NAME=coursemanagement | ||
|
||
db: | ||
image: mysql:8.0 | ||
environment: | ||
MYSQL_ROOT_PASSWORD: 1234 | ||
MYSQL_DATABASE: coursemanagement | ||
ports: | ||
- "3306:3306" | ||
volumes: | ||
- mysql-data:/var/lib/mysql | ||
- ./create_table.sql:/docker-entrypoint-initdb.d/create_table.sql | ||
|
||
volumes: | ||
mysql-data: |
This file contains 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