-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve docker compose settings and add mysql as dependency (#4)
Move docker-compose.yml to the root path. From now on, use `docker compose up` will bring up everything in this project. To bring up api-server, run `docker compose up api-server`, this also boots the dependencies - mongodb, mysqldb. Ctrl+C will only stop api-server. mongo and mysql will remain. To stop all, run `docker compose down`.
- Loading branch information
Showing
7 changed files
with
71 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
# footbook | ||
# What's this | ||
SNS web application developed for learning | ||
|
||
|
||
# How to run | ||
```sh | ||
# to run everything in this project | ||
docker compose up | ||
|
||
# to run specific component of the project with necessary dependency | ||
docker compose up api-server | ||
docker compose up frontend | ||
``` | ||
|
||
|
||
|
||
# How to contribute | ||
**ATTENTION: Please do not directly push any branch or commit to this repo.** | ||
|
||
|
@@ -17,4 +29,10 @@ cd ./footbook | |
|
||
git remote add upstream [email protected]:kunlulukun/footbook.git | ||
git remote set-url --push upstream NO-PUSH | ||
|
||
|
||
# To keep update with latest master branch | ||
git fetch --all | ||
git checkout master | ||
git merge upstream/master | ||
``` |
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
This file was deleted.
Oops, something went wrong.
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,37 @@ | ||
version: '3.8' | ||
services: | ||
api-server: | ||
build: api-server | ||
ports: | ||
- "8000:8000" | ||
environment: | ||
- MONGO_URI=mongodb://localhost:27017 | ||
- MYSQL_HOST=localhost | ||
- MYSQL_PORT=3306 | ||
- MYSQL_USER=kunlulukun | ||
- MYSQL_PWD=1016 | ||
- MYSQL_DB=footbook | ||
depends_on: | ||
- mongo | ||
- mysql | ||
frontend: | ||
build: frontend | ||
ports: | ||
- "3000:80" | ||
depends_on: | ||
- api-server | ||
mongo: | ||
image: mongo | ||
ports: | ||
- "27017:27017" | ||
mysql: | ||
image: mysql:8.0 | ||
environment: | ||
MYSQL_ROOT_PASSWORD: "123456" | ||
MYSQL_DATABASE: "footbook" | ||
MYSQL_USER: "kunlulukun" | ||
MYSQL_PASSWORD: "1016" | ||
volumes: | ||
- ./mysql:/docker-entrypoint-initdb.d | ||
ports: | ||
- "3306:3306" |
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,5 @@ | ||
CREATE TABLE IF NOT EXISTS test ( | ||
id CHAR(36), | ||
name VARCHAR(100), | ||
email VARCHAR(100) | ||
); |