Simple web API to provide information about the first 7 Star Wars movies
10K+
A simple go application to query a Star Wars database in a structured way.
Create a folder for the project and inside this create a docker-compose.yml and insert the following:
version: '3.4'
x-common-variables: &common-variables
MYSQL_DATABASE: go-wars-core
MYSQL_USER: go-sw-usr
MYSQL_PASSWORD: password
services:
mariadb:
image: mariadb:latest
environment:
<<: *common-variables
MYSQL_ROOT_PASSWORD: password
restart: on-failure
volumes:
- ${PWD}/mariadb:/var/lib/mysql
networks:
- db-net
go-wars-core:
image: nodstuff/go-wars-core:latest
depends_on:
- mariadb
environment:
<<: *common-variables
restart: always
ports:
- "8080:8080"
networks:
- db-net
networks:
db-net:
driver: "bridge"
Then all you need is:
$ docker-compose up -d
and it will start the app, database and run a migration to create the tables and insert all of the data.
It will run on port 8080 by default, but this can change if you modify the values in the docker-compose file.
To see the swagger docs for the API, just head to <host:port>/swagger/
Content type
Image
Digest
Size
5.6 MB
Last updated
over 5 years ago
docker pull nodstuff/go-wars-core