This repository is a Sample WEB Application created in the MVC model. This program was created using the WEB Application Framework Gin of the Go language.
├── application/
├── infra/
application/
: The code related to Web Application is stored.
infra/
: Codes related to infra are stored.
> docker-compose build
> docker-compose up -d
(Remarks.)
When running the application locally, you will need to load the .env file.
Create a .env
file under /application
.
MYSQL_ROOT_ID=root
MYSQL_ROOT_PASSWORD=pass
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_DATABASE=test
- DB is started by docker container.
> docker-compose -f infra/mysql.yaml build
> docker-compose -f infra/mysql.yaml up -d
- Launch the application.
> go run main.go
When the application is run for the first time, it is necessary to perform migration to the DB.
# migrate to the application directory.
> application/tools/run_migration.sh -v <migration version> -e root:pass@localhost:3306/test -f migration/
to be filled in later