Skip to content

Starter setup for Symfony 4 and Angular 6 Dockerized Project

Notifications You must be signed in to change notification settings

tzgued/Docker-PHP-Symfony-Angular

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Starter setup for Symfony 4 and Angular 6 Dockerized Project

Docker compose for symfony + mysql + angular project

Presentation

This is a docker composed project that can be used to quickly start a SF4 Angular 6 Project. PS:

  • The ports used in the docker-compose.yml maybe not the ones you would love to setup expecially the NGINX on port 81.
  • For developping on Angular I prefer to ng-serve on my machine. It is perfectly fine if you want to add another container based on node and run your dev on it. I may push another version with that.
  • It's my first time doing such contribution to the github community, so feel free to interact in any way you like.

Docker containers:

	DataBase:
	 1. MySQL
	 2. PhpMyAdmin
	
	Server Code:
	 1. PHP
	 2. Apache
 
	 Front End Code:
	 1. NGINX

Usage

Run development environment

$ docker-compose up

or run in background

$ docker-compose up -d

To down environment

$ docker-compose down

Useful

Show all container

$ docker-compose ps

Connect to container

$ docker exec -it {container_name} bash

Fix minor problem with docker images

$ docker-compose up --force-recreate

Hacks

For correct work with angular app you must fix package.json

"scripts": {
    "ng": "ng",
    "start": "ng serve --host 0.0.0.0",
    ....

Access to projects

Symfony: http://localhost:82

Angular: http://localhost:4200

Phpmyadmin: http://localhost:8080