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 deployment, .env file not found #2338

Closed
Stradi opened this issue Jun 1, 2024 · 4 comments · Fixed by #2355
Closed

[Bug]: Docker Compose deployment, .env file not found #2338

Stradi opened this issue Jun 1, 2024 · 4 comments · Fixed by #2355
Labels
🐛 Bug Reported issues that need to be reproduced by the team.

Comments

@Stradi
Copy link

Stradi commented Jun 1, 2024

Description

I got the following error while deploying using Docker Compose deployment. Previously, there were no issues but I think something has changed since.

Minimal Reproduction (if possible, example repository)

Since the repository is private, I can't give the URL, but here is my Docker Compose file.

name: my-app

services:
  backend:
    build:
      context: ../apps/backend
    depends_on:
      timeseries-db:
        condition: service_healthy
    environment:
      - CRON_KEY=secret
      - QUESTDB_DATABASE=questdb
      - QUESTDB_HOST=timeseries-db
      - QUESTDB_PORT=8812
      - QUESTDB_USER=admin
      - QUESTDB_PASSWORD=quest
      - LIBSQL_DB_AUTH_TOKEN=basic:YWRtaW46YWRtaW4=
      - LIBSQL_DB_URL=https://db.example.com
  timeseries-db:
    image: questdb/questdb:latest
    volumes:
      - questdb-data:/var/lib/questdb
    healthcheck:
      test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/9003' || exit 1
      interval: 5s
      timeout: 15s
      retries: 5

volumes:
  questdb-data:

networks:
  web:

Custom build command:

docker compose -f ./docker/docker-compose.production.yml build

Custom start command:

docker compose -f ./docker/docker-compose.production.yml up -d

Exception or Error

... Container building logs

[2024-Jun-01 17:35:21.477288] Removing old containers.
[2024-Jun-01 17:35:21.920331]

[COMMAND] docker network connect i8ocww4 coolify-proxy || true
[OUTPUT]
Error response from daemon: endpoint with name coolify-proxy already exists in network i8ocww4

[2024-Jun-01 17:35:22.184837]

[COMMAND] docker exec kowgwg4 bash -c 'cd /artifacts/kowgwg4 && docker compose -f ./docker/docker-compose.production.yml up -d'
[OUTPUT]
env file /artifacts/kowgwg4/docker/.env not found: stat /artifacts/kowgwg4/docker/.env: no such file or directory

[2024-Jun-01 17:35:22.271622] Oops something is not okay, are you okay? 😢

[2024-Jun-01 17:35:22.275654] env file /artifacts/kowgwg4/docker/.env not found: stat /artifacts/kowgwg4/docker/.env: no such file or directory

Version

v4.0.0-beta.293

@andrasbacsai andrasbacsai added 🐛 Bug Reported issues that need to be reproduced by the team. 🚧 Next Issues and PRs planned for the next release. labels Jun 4, 2024
Copy link
Member

The next version will have a fix. Coolfiy will automatically add `--project-directory` to the custom commands (if it does not exists) to make sure the context is correct.

@Stradi
Copy link
Author

Stradi commented Jun 5, 2024

The next version will have a fix. Coolfiy will automatically add --project-directory to the custom commands (if it does not exists) to make sure the context is correct.

Thanks for the quick fix man, waiting for the next release 👀

@andrasbacsai andrasbacsai removed the 🚧 Next Issues and PRs planned for the next release. label Jun 12, 2024
@enesbala5
Copy link

This is not working for me. This is my build command:

docker compose --env-file .env --env-file .env.prod -f docker-compose.yaml -f docker-compose.prod.yaml build

Is there an issue with my command or is Coolify not working? Running this on my system directly works without issues.

I can upload the docker-compose.yaml files if that helps.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 3, 2024
@coollabsio coollabsio unlocked this conversation Oct 5, 2024
@peaklabs-dev
Copy link
Member

@enesbala5 If this is still an issue please file a new bug report Issue for that with a sample compose file.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 Bug Reported issues that need to be reproduced by the team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants