Compare commits
3 commits
983bb26c9d
...
712651c39b
Author | SHA1 | Date | |
---|---|---|---|
|
712651c39b | ||
|
ba3b1aea8b | ||
|
59b7d2a381 |
3 changed files with 11 additions and 4 deletions
|
@ -1,7 +1,11 @@
|
|||
# Court - A URL Shortener
|
||||
|
||||
Only based on go standard library and PostGres
|
||||
|
||||
## How to run it
|
||||
|
||||
`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 `/`)
|
||||
|
|
|
@ -8,6 +8,8 @@ services:
|
|||
POSTGRES_DB: court
|
||||
volumes:
|
||||
- ./initdb/:/docker-entrypoint-initdb.d
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready"]
|
||||
court:
|
||||
build: .
|
||||
ports:
|
||||
|
@ -15,4 +17,5 @@ services:
|
|||
environment:
|
||||
DB_HOST: db
|
||||
depends_on:
|
||||
- db
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
INSERT INTO court (id, url) VALUES ('aaaaaa', 'https://www.google.com/');
|
||||
INSERT INTO court (id, url) VALUES ('bbbbbb', 'https://go.dev/')
|
||||
INSERT INTO court (id, url) VALUES ('google', 'https://www.google.com/');
|
||||
INSERT INTO court (id, url) VALUES ('godoc', 'https://go.dev/')
|
||||
|
|
Loading…
Reference in a new issue