Tuesday, 12 June 2018

Docker

Laradock

To run fotobudka environment: docker-compose up -d mysql nginx
To stop fotobudka environment: docker-compose stop

Installation:
With default configuration docker is going to crash due to running apache on Mac on port 80. We need to change port for nginx in laradock/.env file to any other then 80, might be 8080. So it goes like this:

NGINX_HOST_HTTP_PORT=8080

Also we can change it for apache in case we want to use it:

APACHE_HOST_HTTP_PORT=8080

I had another issue with starting nginx becasue of 443 port allocation. When typed docker ps it showed fucking traefik:1.3-alpine that runs on 443 port. So I stopped it with docker stop container_id. Then I all worked.

Another thing is the configuration of nginx. Laradock comes with several default configuration files for nginx depends on framework you want to run. I don't really know how to force it to use the one I want, so I just provided one tiny change in default.conf and changed this:
root /var/www/public;

into this:

root /var/www/public_html;

because for fotobudka public code is in public_html directory, as it's a default public directory on mydevil.net.

Login to SSH: docker-compose exec workspace bash