From 1ee9cd3de14e68c8ac459a8d1e6b3376ba93dfbb Mon Sep 17 00:00:00 2001 From: dw-0 Date: Thu, 31 Oct 2024 13:37:56 +0100 Subject: [PATCH] Feature/set stack and container names in docker-compose files (#4000) * Set stack and container names in docker-compose files * Update changelog --------- Signed-off-by: Dominik Willner --- CHANGELOG.md | 6 ++++++ docker/docker-compose.build.yml | 4 ++++ docker/docker-compose.dev.yml | 5 +++-- docker/docker-compose.yml | 4 ++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6feab65bb..0ed7f9af4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Added + +- Set the stack and container names in the `docker-compose` files (`docker-compose.yml`, `docker-compose.build.yml` and `docker-compose.dev.yml`) + ## 2.120.0 - 2024-10-30 ### Added diff --git a/docker/docker-compose.build.yml b/docker/docker-compose.build.yml index 02442c0c2..9cc8eb1dc 100644 --- a/docker/docker-compose.build.yml +++ b/docker/docker-compose.build.yml @@ -1,6 +1,8 @@ +name: ghostfolio_build services: ghostfolio: build: ../ + container_name: gf-application-build init: true env_file: - ../.env @@ -23,6 +25,7 @@ services: postgres: image: docker.io/library/postgres:15 + container_name: gf-postgres-build env_file: - ../.env healthcheck: @@ -35,6 +38,7 @@ services: redis: image: docker.io/library/redis:alpine + container_name: gf-redis-build env_file: - ../.env command: ['redis-server', '--requirepass', $REDIS_PASSWORD] diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index 91f8f2c09..39a1d56e9 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -1,7 +1,8 @@ +name: ghostfolio_dev services: postgres: image: docker.io/library/postgres:15 - container_name: postgres + container_name: gf-postgres-dev restart: unless-stopped env_file: - ../.env @@ -12,7 +13,7 @@ services: redis: image: docker.io/library/redis:alpine - container_name: redis + container_name: gf-redis-dev restart: unless-stopped env_file: - ../.env diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 642912b73..b8215c978 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,6 +1,8 @@ +name: ghostfolio services: ghostfolio: image: docker.io/ghostfolio/ghostfolio:latest + container_name: gf-application init: true cap_drop: - ALL @@ -27,6 +29,7 @@ services: postgres: image: docker.io/library/postgres:15 + container_name: gf-postgres cap_drop: - ALL cap_add: @@ -49,6 +52,7 @@ services: redis: image: docker.io/library/redis:alpine + container_name: gf-redis user: '999:1000' cap_drop: - ALL