docker dev

This commit is contained in:
dzj 2023-08-29 19:51:37 +08:00
parent c03020069e
commit c91f3744b8
2 changed files with 33 additions and 0 deletions

33
compose-dev.yaml Normal file
View File

@ -0,0 +1,33 @@
services:
app:
entrypoint:
- sleep
- infinity
image: docker/dev-environments-java:stable-1
container_name: app-01
init: true
volumes:
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock
postgres:
image: postgres
container_name: postgre-01
ports:
- "5432:5432"
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: "11111111"
POSTGRES_DB: y9_public
PGDATA: "/var/lib/postgresql/data/pgdata"
volumes:
- d:/docker-data/postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d y9_public"]
interval: 10s
timeout: 5s
retries: 3