Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Docker Compose Deployments Still Have Issues If Repo Files Are Needed. #5182

Open
DanyaalMajid opened this issue Feb 19, 2025 · 5 comments
Labels
🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization.

Comments

@DanyaalMajid
Copy link

Error Message and Logs

Description

We are encountering issues with Docker Compose deployments when repository files are required, similar to past issues referenced below.

The Dockerfile and docker-compose.yml are located in the docker/ directory in the repository. They are properly detected in the dashboard, but deployment fails with an error stating that the /artifacts/docker directory does not exist.

Related Issues

These issues seem related, but our case appears to be a new variation of the problem.

Build Log

Starting deployment of danyaal-majid/replica-backend:main to localhost.
Preparing container with helper image: ghcr.io/coollabsio/coolify-helper:1.0.6.
[CMD]: docker rm -f z0808gscooo8coc8o008ks08
Error response from daemon: No such container: z0808gscooo8coc8o008ks08
[CMD]: docker run -d --network coolify --name z0808gscooo8coc8o008ks08 --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/coollabsio/coolify-helper:1.0.6
7de73f56514fdea3ad93ed41d11de4d58f98e526dafb870ed47d80fc45d6aa9f
[CMD]: docker exec z0808gscooo8coc8o008ks08 bash -c 'GIT_SSH_COMMAND="ssh -o ConnectTimeout=30 -p 22 -o Port=22 -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" git ls-remote [https://x-access-token:<REDACTED>@github.com/DanyaalMajid/replica-backend.git](https://x-access-token:%3CREDACTED%[email protected]/DanyaalMajid/replica-backend.git) main'
76aa2432285ef42460f8f898cadab0c4e109abed	refs/heads/main
9495055499d8b523b47138781da4a292870fee0f	refs/remotes/origin/main
----------------------------------------
Importing DanyaalMajid/replica-backend:main (commit sha HEAD) to /artifacts/z0808gscooo8coc8o008ks08.
[CMD]: docker exec z0808gscooo8coc8o008ks08 bash -c 'git clone -b "main" [https://x-access-token:<REDACTED>@github.com/DanyaalMajid/replica-backend.git](https://x-access-token:%3CREDACTED%[email protected]/DanyaalMajid/replica-backend.git) /artifacts/z0808gscooo8coc8o008ks08 && cd /artifacts/z0808gscooo8coc8o008ks08 && GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" git submodule update --init --recursive && cd /artifacts/z0808gscooo8coc8o008ks08 && GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" git lfs pull'
Cloning into '/artifacts/z0808gscooo8coc8o008ks08'...
[CMD]: docker exec z0808gscooo8coc8o008ks08 bash -c 'cd /artifacts/z0808gscooo8coc8o008ks08 && git log -1 76aa2432285ef42460f8f898cadab0c4e109abed --pretty=%B'
Add docker configurations.
[CMD]: docker exec z0808gscooo8coc8o008ks08 bash -c 'stat -c '%F' /artifacts/z0808gscooo8coc8o008ks08.'
stat: can't stat '/artifacts/z0808gscooo8coc8o008ks08.': No such file or directory
Pulling & building required images.
[CMD]: docker exec z0808gscooo8coc8o008ks08 bash -c 'SOURCE_COMMIT=76aa2432285ef42460f8f898cadab0c4e109abed COOLIFY_BRANCH=main  docker compose --env-file /artifacts/z0808gscooo8coc8o008ks08/.env --project-name s0s00o8440gwsoososo0o4gk --project-directory /artifacts/z0808gscooo8coc8o008ks08 -f /artifacts/z0808gscooo8coc8o008ks08/docker/docker-compose.yml build --pull'
Service celery  Building
Service fastapi  Building
resolve : lstat /artifacts/docker: no such file or directory
Oops something is not okay, are you okay? 😢
Service celery  Building
Service fastapi  Building
resolve : lstat /artifacts/docker: no such file or directory

Steps to Reproduce

Steps to Reproduce

  1. Set up a repository with a Dockerfile and docker-compose.yml inside a subdirectory (e.g., docker/).
  2. Connect the repository to Coolify and ensure it detects the Docker Compose setup.
  3. Enable the "Preserve Repository During Deployment" Option.
  4. Trigger a deployment using the Coolify dashboard.
  5. Observe the build log, which should show errors related to missing /artifacts/docker directory.
  6. The deployment fails with the error:
   resolve : lstat /artifacts/docker: no such file or directory

This issue seems related to previous problems with handling repository files in deployments.

Example Repository URL

No response

Coolify Version

v4.0.0-beta.394

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Ubuntu 24.10

Additional Information

No response

@DanyaalMajid DanyaalMajid added 🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization. labels Feb 19, 2025
@nuxwin
Copy link

nuxwin commented Feb 21, 2025

@andrasbacsai For the record, the issue is caused by word wrapping. Disabling it resolves the problem:

File: /var/www/html/resources/views/components/form/monaco-editor.blade.php:

...
wordWrap: 'off',
...

Of course, disabling word wrapping is not the proper solution. I believe there's a bug elsewhere, but this serves as a temporary workaround.

@nuxwin
Copy link

nuxwin commented Feb 22, 2025

@andrasbacsai Sorry, the comment below was not for this issue ... The right issue: #5159

@MarArMar
Copy link

Having the same problem

Locally the docker compose works, but Coolify fails to build with

2025-Feb-22 18:13:40.580570
Oops something is not okay, are you okay? 😢
2025-Feb-22 18:13:40.584546
Service nginx-test  Building
2025-Feb-22 18:13:40.584546
resolve : lstat /deployment: no such file or directory
2025-Feb-22 18:13:40.584546
exit status 17

This is an my docker compose using a custom nginx Dockerfile :

./deployment/NginxTest/docker-compose.yml

services:
  nginx-test:
    hostname: nginx-test
    image: nginx-test:latest
    restart: on-failure:2
    build:
      context: ../../
      dockerfile: ./deployment/NginxTest/Dockerfile.NginxTest
      target: nginx-test
    ports:
      - 8888:80
    expose:
      - 8888

I believe the Dockerfile can be as simple as :

./deployment/NginxTest/Dockerfile.NginxTest

FROM nginx:1.27.4 AS nginx-test

RUN apt-get update && apt-get upgrade -y

ENTRYPOINT ["/bin/bash","tail" "-f" "/dev/null "]

@MarArMar
Copy link

Putting the same exact docker compose file at the root of the repo (and puttong context : . ) solved the problem 👍

@DanyaalMajid
Copy link
Author

I stumbled on the same thing, but there were issues in my compose file, so I though that may have been the problem.

Basically docker compose files in sub directories cause breakage of builds, Docker files themselves can be kept in sub directories. But the compose file must be in the root always.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization.
Projects
None yet
Development

No branches or pull requests

3 participants