Sign inSign up

scottseo/dvdstore-api

By scottseo

•Updated almost 10 years ago

This is a DVD Store API. The purpose of the API is to demo API design and Dev Ops discipline.

Image
0

241

scottseo/dvdstore-api repository overview

latest (latest/Dockerfile)⁠

 

⁠How to use this image

⁠1. Start the database docker image scottseo/dvdstore-db
$ docker run --name dvdstore-db -p 5432:5432 -e POSTGRES_USER=dbuser -e POSTGRES_PASSWORD=password -e POSTGRES_DB=dellstore2 -d scottseo/dvdstore-db                                                                               
⁠ 
⁠Environment Variables for DB
⁠POSTGRES_USER

DB user

⁠POSTGRES_PASSWORD

DB password

⁠POSTGRES_DB

DB instance name

⁠ 
⁠2. Upload the config to web server or S3
db.url=jdbc:postgresql://dockerhost:5432/dellstore2?currentSchema=public
db.user=dbuser
db.pwd=password

Config example. Keep in mind that dockerhost is an alias used while launching the API app server

https://s3.amazonaws.com/mydomain.com/staging/config.properties

S3 URL example. Path /staging/ is used as an indicator for deployment environment

https://mydomain.com/staging/config.properties

Web server URL. Config file can be hosted with http or https.

  • You can secure your configs by providing S3 URL. S3 can be set up to use the EC2 instance profile in deciding who gets access to the configs.
⁠ 
⁠3. Start the API app server
$ docker run --name dvdstore-api -d -p 8080:8080 --link dvdstore-db:dockerhost -e SWS_API_CONFIG_URL=https://s3.amazonaws.com/mydomain.com/staging/config.properties scottseo/dvdstore-api

Notice the --link dvdstore-db:dockerhost dockerhost is the hostname used in the config

⁠ 
⁠Environment Variables for API
⁠com.scottwseo.api.CONFIG_URL

Use the URL from Step 2

Tag summary

Content type

Image

Digest

Size

73.3 MB

Last updated

almost 10 years ago

docker pull scottseo/dvdstore-api