Updated docker-compose.md (#1827)

This commit is contained in:
jaw3l 2022-05-20 05:43:57 +03:00 committed by GitHub
parent e7d44f5f8c
commit b86ebd8968
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 4 deletions

View File

@ -15,7 +15,7 @@ version: '2'
services: services:
web: web:
build: . build:
# build from Dockerfile # build from Dockerfile
context: ./Path context: ./Path
dockerfile: Dockerfile dockerfile: Dockerfile
@ -220,7 +220,7 @@ networks:
### Volume ### Volume
```yaml ```yaml
# Mount host paths or named volumes, specified as sub-options to a service # mount host paths or named volumes, specified as sub-options to a service
db: db:
image: postgres:latest image: postgres:latest
volumes: volumes:
@ -230,3 +230,15 @@ networks:
volumes: volumes:
dbdata: dbdata:
``` ```
### User
```yaml
# specifying user
user: root
```
```yaml
# specifying both user and group with ids
user: 0:0
```