Variáveis de Ambiente
~/compose$ ls
compose.yaml
~/compose$ vim compose.yaml
Last updated
~/compose$ ls
compose.yaml
~/compose$ vim compose.yaml
Last updated
version: "3.8"
services:
postgre:
image: postgres:13.16
ports:
- 5432:5432
environment:
POSTGRES_PASSWORD: kubenews
POSTGRES_USER: kubenews
POSTGRES_DB: kubenews~/compose$ docker compose up -d
[+] Running 1/1
✔ Container compose-postgre-1 Started~/compose$ docker compose up -d
WARN[0000] /home/marcelo/compose/compose.yaml: the attribute `version` is obsolete,
it will be ignored, please remove it to avoid potential confusion
WARN[0000] Found orphan containers ([nginx02 nginx]) for this project.
If you removed or renamed this service in your compose file,
you can run this command with the --remove-orphans flag to clean it up.
[+] Running 1/1
✔ Container compose-postgre-1 Started$ docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
NAMES
3ff758148126 postgres:13.16 "docker-entrypoint.s…" 6 minutes ago Up 5 minutes 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp compose-postgre-1
06e0af593137 nginx:latest "/docker-entrypoint.…" 24 hours ago Exited (255) 16 minutes ago 0.0.0.0:8181->80/tcp, :::8181->80/tcp nginx02
7542994383e7 nginx:latest "/docker-entrypoint.…" 24 hours ago Exited (255) 16 minutes ago 0.0.0.0:8080->80/tcp, :::8080->80/tcp nginx$ docker compose up -d --remove-orphans
WARN[0000] /home/marcelo/compose/compose.yaml: the attribute `version` is obsolete,
it will be ignored, please remove it to avoid potential confusion
[+] Running 3/0
✔ Container nginx Removed 0.0s
✔ Container nginx02 Removed 0.0s
✔ Container compose-postgre-1 Running 0.0s$ docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3ff758148126 postgres:13.16 "docker-entrypoint.s…" 7 minutes ago Up 7 minutes 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp compose-postgre-1