Dockerized project of a minimal webserver using deno, oak and oakCors. Initializes a postgres volume and creates a new database products.
Initialize containers and volumes: docker compose up -d
Initialization process:
docker compose up -d
executes command fromdocker-compose.yml
- Deno executes
start_watcher
fromdeno.json
- Installsdenon
- Denon executes
startup
fromscripts.config.ts
- Runs./src/index.ts
docker_prototype/
├── src
│ ├── deps.ts
│ ├── index.ts
│ ├── log.ts
│ └── routes.ts
├── tests
│ └── routes_test.ts
├── README.md
├── docker-compose.yml
├── .env
GET-requests: 127.0.0.1:8080
/
: answered with static JSON-response/read
: returns data from/home/christian/demodata/clients.csv
(docker: bind mount)
Note regarding hostnames in Docker environment:
- For IP-addresses instead of trying
127.0.0.1
use theservice_name
from docker-compose.yml - For me it is still unclear how these IPs can be used in deno-command for allowing specific network addresses