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

docker-compose up command doesn't work #747

Open
alizeinodin opened this issue Nov 7, 2024 · 3 comments
Open

docker-compose up command doesn't work #747

alizeinodin opened this issue Nov 7, 2024 · 3 comments

Comments

@alizeinodin
Copy link

Sail Version

1.37.1

Laravel Version

11.3.1

PHP Version

8.3

Operating System

Linux

OS Version

22.04

Description

When I use the ./vendor/bin/sail up command to run my application, everything works, but I want to run it using the docker-compose up command. When I use docker-compose up—d, some problems occur.

  1. In the .env file, I change ports of such containers like Mysql, etc but not working and says the port is allocated.
  2. When the application runs, an error occurs that says bootstrap is not writable and I must change the permissions of the bootstrap directory to work properly.

This second problem occurs because Sail creates a new user gives it the right permissions and runs commands by this user, but usually, we use docker-compose commands to deploy applications. I expect this command to work properly.

Steps To Reproduce

./vendor/bin/sail build
docker-compose up -d

@martinbean
Copy link

@alizeinodin Why are you happy to use the sail command to build the containers (instead of docker-compose build), but not to actually start the containers?

@alizeinodin
Copy link
Author

alizeinodin commented Nov 12, 2024

I have an external network in docker-compose file. When I run sail up command, a warning occurs and command doesn't anything! So I must use docker-compose up command.

Also, It's clearly that I was created this network and I can run my application by docker-compose up command.

WARN[0000] a network with name test_sail exists but was not created by compose. Setexternal: trueto use an existing network network test_sail was found but has incorrect label com.docker.compose.network set to ""

My docker compose file:

networks:
sail:
driver: bridge
test_sail:
external: true

@martinbean
Copy link

@alizeinodin The error message seems to be pretty clear? If you’re trying to use a network that was created outside of the Docker Compose (Sail) project, you therefore need to mark it as external.

Why are you creating networks outside of your Docker Compose/Sail project in the first place? It kinda defeats the point of using containerisation if you’re not going to actually define all of the services contained within.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants