A Spring Boot Rest Service with two endpoints
333
https://github.com/kunupat/bar
Use Docker environment variables to override spring.datasource.url, spring.datasource.username and spring.datasource.password properties. E.g.:
docker run
-m 0.25g
-p 8081:8081
-e spring.datasource.url=jdbc:postgresql://{your_db_url}/BarDB
-e spring.datasource.username={your_db_user_name}
-e spring.datasource.password={your_db_user_password}
--rm
--name bar.service.api
81f62041be5a
Use SQL scripts listed under SQL section to create BarDB database and movies table.
/data : Fetch data from PostgreSQL/actuator/health : A health check endpointPort: 8081http://localhost:8081/datahttp://localhost:8081/actuator/health
CREATE DATABASE "BarDB"
WITH
OWNER = postgres
ENCODING = 'UTF8'
LC_COLLATE = 'English_United States.1252'
LC_CTYPE = 'English_United States.1252'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
CREATE TABLE movies(
movie_id serial PRIMARY KEY,
movie_name VARCHAR (50) NOT NULL,
release_year VARCHAR (4) NOT NULL
);
commit;
insert into movies (movie_name, release_year) values('The Shawshank Redemption','1994');
insert into movies (movie_name, release_year) values('Se7en','1995');
insert into movies (movie_name, release_year) values('Fight Club','1999');
commit;
JAEGER_SERVICE_NAME=bar
JAEGER_SAMPLER_TYPE=const
JAEGER_SAMPLER_PARAM=1
JAEGER_REPORTER_LOG_SPANS=true
JAEGER_ENDPOINT=http://{Your_Jaeger_Server}:14268/api/traces
Content type
Image
Digest
Size
265.4 MB
Last updated
almost 7 years ago
docker pull kunupat/bar