bourdeau / docker-symfony4

:whale: Symfony 4 with Docker Compose and PHP 7.2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker Symfony 4

Install Docker

See doc: https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/

sudo usermod -aG docker ${USER}
sudo reboot

Install docker-symfony4 & containers

git clone https://github.com/bourdeau/docker-symfony4.git && cd docker-symfony4

vim .env
# Edit env variables to match your application

docker-compose up -d

Set up your Symfony4 application

# The path you defined above in .env
cd $SYMFONY_PATH
vim .env
# Set DATABASE_URL with the env variable you defined above

You are done!

Visit: http://localhost:8080

Connect to a container

docker exec -it <CONTAINER_NAME> bash

# Composer is intalled in the apache container so you can:
cd /var/www/app && composer install --prefer-dist

Deploy to Heroku

# Create the app
heroku create bourdeau-symfony

# Push the app
heroku container:push symfony --app bourdeau-symfony

# Add a dyno
heroku ps:scale symfony=1

heroku container:release symfony
heroku open --app bourdeau-symfony

heroku logs --tail

# List dyno

heroku ps
# Restart a dyno
heroku restart symfony.1

About

:whale: Symfony 4 with Docker Compose and PHP 7.2


Languages

Language:PHP 58.2%Language:Shell 30.2%Language:Dockerfile 9.0%Language:HTML 2.6%