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
Project ID:
N/A
N/A
please share the compose file and all the commands you need to run and where
i have these files
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
well first off, your dockerfile should be doing compose install
mmm how?
composer install*
I do the composer install inside the container, after docker exec -it bash
do it in your dockerfile
via RUN
okey ill see how
after the composer install i do this
![No description](https://cdn.answeroverflow.com/1231353155673915423/image.png)
you'd do all the artisan stuff in the dockerfile too, and you might not need chown at all
like this?
![No description](https://cdn.answeroverflow.com/1231353676593889360/image.png)
you should not be doing multiple updates and installs, condense all apt stuff into a single command
like this?
![No description](https://cdn.answeroverflow.com/1231356111563657266/image.png)
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