-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
## Fields
Setting fields like `dockerfile`, `command`, `volume` and `environment`.
```yaml
services:
mya_app:
build:
context: ..
dockerfile: .devcontainer/Dockerfile
command: sleep infinity
volumes:
- ..:/workspace
environment:
- DEBUG=0
- ENVIRONMENT=local
ports:
- "8000:8000"
- "8081:8081"
depends_on:
- my_app_db
```
For external services, it can be shorter:
```yaml
services:
my_app_db:
image: postgres:14
volumes:
- my_app_db_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U commodities" ]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:alpine
ports:
- "6379:6379"
nginx:
container_name: nginx
image: nginx:1.18
ports:
- "80:80"
volumes:
- "./nginx.conf:/etc/nginx/conf.d/default.conf"
```
You can set credentials in `environment` for a DB but it could be better to use unversioned secrets file instead.
Metadata
Metadata
Assignees
Labels
No labels