Docker Cheat Sheet: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
Zeile 10: | Zeile 10: | ||
<h2>Dateien</h2> | <h2>Dateien</h2> | ||
docker-compose.yaml | docker-compose.yaml | ||
<syntaxhighlight lang=yaml> | |||
version: '3' | |||
services: | |||
db: | |||
image: postgres:9.6.5-alpine | |||
volumes: | |||
- pgdata:/db/pgdata | |||
restart: always | |||
ports: | |||
- 5432:5432 | |||
environment: | |||
POSTGRES_PASSWORD: 123456 | |||
PGDATA: /db/pgdata | |||
volumes: | |||
pgdata: | |||
</syntaxhighlight> | |||
Dockerfile | Dockerfile |
Version vom 4. Oktober 2017, 18:53 Uhr
Commands
docker-compose up -d
docker-compose down
docker exec -i -t container_name /bin/bash
Dateien
docker-compose.yaml
version: '3'
services:
db:
image: postgres:9.6.5-alpine
volumes:
- pgdata:/db/pgdata
restart: always
ports:
- 5432:5432
environment:
POSTGRES_PASSWORD: 123456
PGDATA: /db/pgdata
volumes:
pgdata:
Dockerfile
Links
https://docs.docker.com/compose/gettingstarted/#step-4-build-and-run-your-app-with-compose
https://docs.docker.com/compose/wordpress/#build-the-project
https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices