Skip to content

RedNeath/docker-example

Repository files navigation

docker-example

How to run the project

As you can see in the docker-compose.yml file, the project relies on 5 docker containers. Luckily, there is a Makefile (which will only work on Linux) that contains most of the required commands.

For windows users, you will need to install wsl. We advice you to install docker first, as it comes with a wsl pre-installed.

Install docker

You can find how to install it on your computer from here: https://docs.docker.com/get-started/get-docker/

Install make

This is for being able to run the commands of the Makefile. For windows users: please make sure you run the commands in your wsl terminal, not in your powershell or cmd!

The make command is theoretically available in all Linux distributions. Some may even have it installed by default.

Here's how to get it in Debian based distributions:

sudo apt-get install make

NOTE:
For windows users, using the default linux distribution, shipped with docker, know that it is a Ubuntu distribution, meaning the command above should work for you.

Start!

Once this is installed, you can finally start the project with the following commands:

make start

or

make run

The two commands does the same thing, except the run detaches your terminal from the docker container's output, letting you execute other commands later.

NOTE:
If the two commands above fail, please refer to the Submodules section of the Important notes part!

Migrate

We are almost done, but there is one last thing to do: migrate to the latest version for the database.

In order to do so, you need to open a bash session on your web container:

make wsh

And then run this command, that will execute all the migrations:

php bin/console doctrine:migrations:migrate

And that's it. You can fully use your application!

Stop the containers

If you don't have the docker desktop tool (or any other utility that can allow you to do that graphically), you can use this command to stop the containers:

make stop

Use the application

Once started, you can go to the following URLs to see the application in action:

If you want to add the database to your IDE database explorer, you can use the following connection string:

mysql://docker-example-user:docker-example-user-password@localhost:8086/docker-example-db?charset=utf8mb4

Improtant notes

Ownership

If you face ownership problems, you can use the command:

make owner

that will give your system ownership of all the files under the docker-example-php and docker-example-vue folders.

Submodules

This project uses submodules! Make sure you use the --recursive flag when cloning it from the VCS:

git clone --recursive <URL or SSH string>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published