semaphore/docker-compose.yml hinzugefügt

This commit is contained in:
2025-08-04 10:47:07 +00:00
parent 525be5f7d2
commit 0846465b56

View File

@@ -0,0 +1,34 @@
services:
database:
# Use the official Postgres image from Docker Hub
image: postgres:15-alpine
# Restart the container if it fails
restart: always
# Use a volume to persist the database data
volumes:
- ${POSTGRES_VOLUME_NAME}:/var/lib/postgresql/data
# Load environment variables from the .env file
env_file:
- .env
semaphore:
# Use the official Semaphore image
image: semaphoreui/semaphore:v2.9.2
# The application depends on the database service
depends_on:
- database
# Restart the container if it fails
restart: always
# Map the host port to the container's fixed port 3000
ports:
- "${SEMAPHORE_PORT_HOST}:3000"
# Load environment variables from the .env file
env_file:
- .env
# The command to run the Semaphore container, which will wait for the database
command: >
sh -c 'while ! pg_isready -h database -p 5432 > /dev/null 2> /dev/null; do sleep 1; done && /usr/bin/semaphore --config /etc/semaphore/semaphore.json'
volumes:
# Define a named volume for the persistent database data
${POSTGRES_VOLUME_NAME}: