KagisB / Mapon-Prakse-backend-projekts

0 stars 0 forks source link

Project on nginx docker #12

Open KagisB opened 2 years ago

KagisB commented 2 years ago

Got the server to display files, now need to get them to work properly. First step : getting the mysqli extension to work/be installed on the php container, so it can log in the database+ probably getting to connect to the phpmyadmin+mysql dockers, that are also not in the compose. Or maybe add them into the compose? Also a possibility.

KagisB commented 2 years ago

Put the mysql docker inside docker-compose as well. Now just need to think about how to make sure the database tables are created correctly, when starting the server, so login part works. Also, how to insert data into the table, mysql script preferably, but not sure how to get hashed passwords that way, that i could also check in php.

KagisB commented 2 years ago

Now the project works, probably messy way to get things done, but for now it works, properly gets/checks the users from the database, and displays everything. Also, routing works again. Now to reorganize the file hierarchy to be more suitable to be made into a docker container/displayed on git.

Rozkalns commented 2 years ago
  1. All the docker files, docker compose yaml files also should be published to git, so we can spin the project up on our machines.
  2. It is perfect idea to keep all the necessary containers into the docker compose file, instead spawning them one by one using run commands.
  3. For initial database things, I would suggest to use migrations. For example, phinx is good package to manage database migrations.
KagisB commented 2 years ago

1) Will try to put them in the project folder and then commit changes. Probably will be committed to a new branch. 3) Will look into it, it is a small problem right now where I was thinking about how to best create and fill in the User table, so I can properly check the passwords.

KagisB commented 2 years ago

Docker files have been merged on the main branch,- haven't tested properly, if it works on other computers yet and if there aren't massive issues when doing so. I've created basic database migration and seeding with phinx, don't like that you have to run commands in a terminal to get it to work, but i guess it's fine for now.

Rozkalns commented 2 years ago

Running phinx commands on the docker is completely fine.

if you check our mapon repository, file _dev/classes/Commands/Initialize.php:23, you'll see that we do this when we start our dev/feature/production docker environments.

KagisB commented 2 years ago

Right now they aren't on docker, i am not quite sure in which place to put them, in which of the containers/dockerfiles to put it.