๐ฉโ๐ป NestJS ็ Docker Compose
็ฐๅขโ
- NestJs
- Postgresql
Docker Compose ๆบๅโ
ๆฐๅฏซ dockerfileโ
ๅ่ ๐ฉโ๐ป NestJS ็ dockerfile ๆฐๅฏซ dockerfile
ๆฐๅฏซ docker-compose.ymlโ
ๅจๅฐๆกๅบไธๅปบ็ซ
docker-compose.yml
version: '3.8'
services:
nest-app:
container_name: nest-app
build:
context: .
dockerfile: Dockerfile
ports:
- "80:3050"
depends_on:
- postgres
environment:
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: test123
POSTGRES_DB: [your_database_name]
postgres:
container_name: postgres12
image: postgres:12.3
environment:
POSTGRES_PASSWORD: test123
ports:
- "5432:5432"
ๅๅโ
docker-compose up