[GH-ISSUE #210] Initial setup: Docker Compose 'name' attribute causing invalid file issue #62

Closed
opened 2026-02-26 18:45:11 +03:00 by kerem · 5 comments
Owner

Originally created by @447011 on GitHub (Jun 16, 2023).
Original GitHub issue: https://github.com/documenso/documenso/issues/210

Happens on my initial setup, not sure if it's generally reproducible or just an edge case on my system. When attempting to start my Docker Compose environment using the command npm run d, an error occurs stating:

ERROR: The Compose file '././docker/compose-without-app.yml' is invalid because:
'name' does not match any of the regexes: '^x-'

Steps to reproduce

  1. Run docker system prune -a to clean the Docker system.
  2. Execute npm run d to start the Docker Compose environment.

Expected result

Docker Compose should start the specified services without any issues.

Actual result

An error message is shown indicating that the 'name' attribute does not match any of the regexes: '^x-'.

System information

  • Docker version: 20.10.7
  • Docker-compose version: 1.29.2
  • OS: MacOS 12.6.4

Proposed solution

The 'name' attribute is not valid in Docker Compose at the top level. We can set the name via an .env file in the /docker directory. Here's the corrected Docker Compose file:

services:
  database:
    image: postgres:15
    container_name: database
    environment:
      - POSTGRES_USER=documenso
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=documenso
    ports:
      - 54320:5432

  inbucket:
    image: inbucket/inbucket
    container_name: mailserver
    ports:
      - 9000:9000
      - 2500:2500
      - 1100:1100

docker/.env

COMPOSE_PROJECT_NAME=documenso

or add name tag to docker-compose command:

docker-compose -p documenso -f ./docker/compose-without-app.yml up
Originally created by @447011 on GitHub (Jun 16, 2023). Original GitHub issue: https://github.com/documenso/documenso/issues/210 Happens on my initial setup, not sure if it's generally reproducible or just an edge case on my system. When attempting to start my Docker Compose environment using the command npm run d, an error occurs stating: ``` ERROR: The Compose file '././docker/compose-without-app.yml' is invalid because: 'name' does not match any of the regexes: '^x-' ``` ## Steps to reproduce 1. Run docker system prune -a to clean the Docker system. 2. Execute npm run d to start the Docker Compose environment. ## Expected result Docker Compose should start the specified services without any issues. ## Actual result An error message is shown indicating that the 'name' attribute does not match any of the regexes: '^x-'. ## System information - Docker version: 20.10.7 - Docker-compose version: 1.29.2 - OS: MacOS 12.6.4 ## Proposed solution The 'name' attribute is not valid in Docker Compose at the top level. We can set the name via an `.env` file in the `/docker` directory. Here's the corrected Docker Compose file: ```yaml services: database: image: postgres:15 container_name: database environment: - POSTGRES_USER=documenso - POSTGRES_PASSWORD=password - POSTGRES_DB=documenso ports: - 54320:5432 inbucket: image: inbucket/inbucket container_name: mailserver ports: - 9000:9000 - 2500:2500 - 1100:1100 ``` `docker/.env` ``` COMPOSE_PROJECT_NAME=documenso ``` or add name tag to docker-compose command: ``` docker-compose -p documenso -f ./docker/compose-without-app.yml up ```
kerem closed this issue 2026-02-26 18:45:11 +03:00
Author
Owner

@Mythie commented on GitHub (Jun 16, 2023):

Thanks for the fantastic issue format! This will have been a leftover from when we upgraded to support the newer docker compose command rather than the old docker-compose variant.

I can get that updated shortly 😄

<!-- gh-comment-id:1594247982 --> @Mythie commented on GitHub (Jun 16, 2023): Thanks for the fantastic issue format! This will have been a leftover from when we upgraded to support the newer `docker compose` command rather than the old `docker-compose` variant. I can get that updated shortly 😄
Author
Owner

@447011 commented on GitHub (Jun 16, 2023):

Awesome thanks, let me know if I should push. I've already a fix on my machine.

<!-- gh-comment-id:1594253720 --> @447011 commented on GitHub (Jun 16, 2023): Awesome thanks, let me know if I should push. I've already a fix on my machine.
Author
Owner

@Mythie commented on GitHub (Jun 16, 2023):

Awesome thanks, let me know if I should push. I've already a fix on my machine.

If you're up to it that'd be great otherwise I'm happy to do so 👍

<!-- gh-comment-id:1594254719 --> @Mythie commented on GitHub (Jun 16, 2023): > Awesome thanks, let me know if I should push. I've already a fix on my machine. If you're up to it that'd be great otherwise I'm happy to do so 👍
Author
Owner

@447011 commented on GitHub (Jun 16, 2023):

Ok will take it 👍

<!-- gh-comment-id:1594255459 --> @447011 commented on GitHub (Jun 16, 2023): Ok will take it 👍
Author
Owner

@447011 commented on GitHub (Jun 16, 2023):

PR: https://github.com/documenso/documenso/pull/211

<!-- gh-comment-id:1594279754 --> @447011 commented on GitHub (Jun 16, 2023): PR: https://github.com/documenso/documenso/pull/211
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#62
No description provided.