Docker image to run Laravel project.
This image contains:
- PHP 7.4
- Nginx
- MySQL
- SQLite3
- Redis
- Certbot
docker pull ricardobarantini/laravel
docker volume create --name mysql_volume
docker run -d -v /path/to/project/laravel:/var/www/html -v mysql_volume:/var/lib/mysql -p 80:80 -p 443:443 -p 3306:3306 --name container_name ricardobarantini/laravel
docker exec -it container_name bash
Inside the container, run the command:
certbot --nginx -d app.tld
At the -d app.tld
just change for the site domain name.
Inside the container, run:
vim /etc/nginx/sites-enabled/default
At the line 5, changes the localhost
to the site domain name.
At the line 6, changes root
path if is necessary.
mysql -u root -p -e "create database name;"
Credentials:
Username0: root
Password: root
docker stop container_name
docker rm container_name
docker run -d -v /path/to/project/laravel:/var/www/html -v mysql_volume:/var/lib/mysql -p 80:80 -p 443:443 -p 3306:3306 --name container_name ricardobarantini/laravel