This commit is contained in:
Sergey Yarkov 2022-03-22 23:13:57 +03:00
parent 1093167ed6
commit e1d5421fa2
2 changed files with 5 additions and 7 deletions

View File

@ -27,7 +27,7 @@ application.
## How to deploy
- 1. Clone this repository `git clone https://github.com/sergeyyarkov/node-docker-example.git .`
- 2. Configure enviroment variables in `docker-compose.yml` if you need to
- 2. Configure enviroment variables in `docker-compose.yml` for `postgres` and `nodejs` serivces if you need to
- 3. Build and run application with `docker compose up --build`
## Requirements

View File

@ -21,9 +21,7 @@ services:
target: production
dockerfile: Dockerfile
ports:
- ${PORT}:${PORT}
env_file:
- .env
- 4000:4000
environment:
- NODE_ENV=production
- PG_HOST=postgres
@ -55,9 +53,9 @@ services:
- ./sql/schema_init.sql:/docker-entrypoint-initdb.d/schema_init.sql
- ./sql/seed.sql:/docker-entrypoint-initdb.d/seed.sql
environment:
POSTGRES_USER: ${PG_USER}
POSTGRES_PASSWORD: ${PG_PASSWORD}
POSTGRES_DB: ${PG_DB_NAME}
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 1234
POSTGRES_DB: articles
ports:
- 5432:5432
networks: