Skip to content

API for directory of the organization with units, employees and phones

License

Notifications You must be signed in to change notification settings

alexchubgit/phones_api_golang

Repository files navigation

Getting Started

Download ZIP from Github

go run main.go

Build app image

docker build -t golang-app .
docker build --no-cache -t alexchub/golang-app:latest .
docker push alexchub/golang-app:latest
docker image rmi alexchub/golang-app:latest

Run App docker container

docker run -d -p 8000:8000 --name app -e MYSQL_URL="phones:ZPwg4wHh@tcp(172.17.0.2:3306)/phones" -e JWT_KEY=VQBbmC9g -v /app/photo:/app/public/photo alexchub/golang-app:latest

Environment variables

MYSQL_URL

MariaDB image into docker hub

docker pull mariadb:10.4
docker tag mariadb:10.4 alexchub/mariadb:10.4
docker push alexchub/mariadb:10.4

Run MariaDB docker container

docker run -d -p 3306:3306 --name mariadb -e MYSQL_ROOT_PASSWORD=ZPwg4wHh -e MYSQL_DATABASE=phones -e MYSQL_USER=phones -e MYSQL_PASSWORD=ZPwg4wHh -v /app/mysql:/var/lib/mysql mariadb:10.4

Check ip address

docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mariadb

Connect to MariaDB server

mysql -h 172.17.0.2 -u phones -P 3306 -p

Create database structure

mysql -h 172.17.0.2 -u phones -p phones < ~/Downloads/Github/phones_api_golang/struct.sql

Licensing

App is MIT licensed.

About

API for directory of the organization with units, employees and phones

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages