Skip to content

Commit

Permalink
Add postgres.yml for local run and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
n0str committed Oct 18, 2023
1 parent bef9dfa commit e9f0d45
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
17 changes: 11 additions & 6 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@
To run application in development mode you need to run `npm run dev` command.
It will start application with `nodemon` and restart it on any changes in source code.

You can try to build and run it in local Docker:
You can try to build and run it in local Docker (see `postgres.yml`):
```
version: "3.2"
services:
api:
build:
dockerfile: Dockerfile
context: .
postgres:
image: postgres
environment:
POSTGRES_PASSWORD: pass
ports:
- "127.0.0.1:3000:3000"
- 127.0.0.1:5432:5432
volumes:
- ./database:/var/lib/postgresql/data
```

To run it execute: `docker compose -f postgres.yml up -d` where `-d` is used for background run.
If you have outdated version of docker, try use `docker-compose` instead of `docker compose` (https://docs.docker.com/compose/)

## Configuration

Default application configuration is stored in `app-config.yaml` file.
Expand Down
10 changes: 10 additions & 0 deletions postgres.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "3.2"
services:
postgres:
image: postgres
environment:
POSTGRES_PASSWORD: pass
ports:
- 127.0.0.1:5432:5432
volumes:
- ./database:/var/lib/postgresql/data

0 comments on commit e9f0d45

Please sign in to comment.