R
Railway5mo ago
emua12

docker deployment

Hi, sorry, I have a question. I want to upload a project to Railway that I have in a repository. Inside the repository, I have a container where I have the database, and that generates another one where I have the project. I'm new to Docker, so I'm not sure how it works exactly, but I know that I run 'sudo docker compose up -d' and it generates 2 containers. Then, inside the container, I have to run some Laravel-specific commands. My question is how to do this with Railway
223 Replies
Percy
Percy5mo ago
Project ID: N/A
emua12
emua125mo ago
N/A
Brody
Brody5mo ago
please share the compose file and all the commands you need to run and where
emua12
emua125mo ago
emua12
emua125mo ago
when i clone the commands are sudo docker compose up -d that generates 2 dockers, pgscomputacion and scomputacion-1 sudo docker exec -it scomputacion-1 bash and then compose install
Brody
Brody5mo ago
well first off, your dockerfile should be doing compose install
emua12
emua125mo ago
mmm how? composer install* I do the composer install inside the container, after docker exec -it bash
Brody
Brody5mo ago
do it in your dockerfile via RUN
emua12
emua125mo ago
okey ill see how
emua12
emua125mo ago
after the composer install i do this
No description
Brody
Brody5mo ago
you'd do all the artisan stuff in the dockerfile too, and you might not need chown at all
emua12
emua125mo ago
like this?
No description
Brody
Brody5mo ago
you should not be doing multiple updates and installs, condense all apt stuff into a single command
emua12
emua125mo ago
like this?
No description
emua12
emua125mo ago
Oh, one more thing I also do BEFORE the php artisan commands is cp .env.example .env and in the .env file I set db_host=pgscomputacion, db_port=5432, db_database=taller, db_user=postgres, db_password=postgres
Want results from more Discord servers?
Add your server