Compare commits

...

3 commits

Author SHA1 Message Date
Léo
712651c39b Improve the README 2024-03-28 12:03:14 +00:00
Léo
ba3b1aea8b Correct the docker compose 2024-03-28 12:02:48 +00:00
Léo
59b7d2a381 change default values 2024-03-28 11:59:46 +00:00
3 changed files with 11 additions and 4 deletions

View file

@ -1,7 +1,11 @@
# Court - A URL Shortener # Court - A URL Shortener
Only based on go standard library and PostGres
## How to run it ## How to run it
`docker compose up -d`, by default it will expose port 8000 `docker compose up -d`, by default it will expose port 8000
*PS: if it fail miserably, relaunch it, it's due to PostGres being long to startup* ## How to manage it
There is a webui on the `/webui` endpoint, it's the only reserved path (with the `/`)

View file

@ -8,6 +8,8 @@ services:
POSTGRES_DB: court POSTGRES_DB: court
volumes: volumes:
- ./initdb/:/docker-entrypoint-initdb.d - ./initdb/:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
court: court:
build: . build: .
ports: ports:
@ -15,4 +17,5 @@ services:
environment: environment:
DB_HOST: db DB_HOST: db
depends_on: depends_on:
- db db:
condition: service_healthy

View file

@ -1,2 +1,2 @@
INSERT INTO court (id, url) VALUES ('aaaaaa', 'https://www.google.com/'); INSERT INTO court (id, url) VALUES ('google', 'https://www.google.com/');
INSERT INTO court (id, url) VALUES ('bbbbbb', 'https://go.dev/') INSERT INTO court (id, url) VALUES ('godoc', 'https://go.dev/')