Skip to content

Instantly share code, notes, and snippets.

@Gabri
Last active October 23, 2020 22:40
Show Gist options
  • Save Gabri/4dc7a00c38103e29294c9af0ea10104d to your computer and use it in GitHub Desktop.
Save Gabri/4dc7a00c38103e29294c9af0ea10104d to your computer and use it in GitHub Desktop.
[VPS Lemp setup] every step to run docker lemp #docker #lemp

In order to give our non-root user access to the Docker management commands, we need to create a docker group (it may already be created for you), and then add your primary user to that group.

$ sudo groupadd docker
$ sudo usermod -aG docker $USER

By running this command, we ask Docker Compose to execute Bash on the PHP container:

docker-compose exec php bash

Logging

This command aggregates the logs of every container, which is extremely useful for debugging:

docker-compose logs -f

It is also possible to display the information of a specific container simply by appending the name of the service:

docker-compose logs -f nginx
docker-compose up -d

NB : (if build and not image for a service) Image for service php was built because it did not already exist. To rebuild this image you must use docker-compose build or docker-compose up --build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment