Full docker app#80
Conversation
|
|
||
| db: | ||
| $(CONSOLE) doctrine:database:create --if-not-exists | ||
| - $(CONSOLE) doctrine:schema:create |
There was a problem hiding this comment.
C'est quoi le signe moins ?
There was a problem hiding this comment.
It continues the script on error.
| lancez simplement ``make boot`` à la racine du projet ou la commande `docker-compose up -d`. | ||
| Cela créera un serveur MariaDB accessible sur le port 3306 de votre machine (si vous êtes sous Mac OS ou Windows, | ||
| vous aurez besoin de travailler avec l'IP de votre machine virtuelle). | ||
| Cela créera un serveur apache accessible sur le port 8080 (que vous pouvez personnaliser dans |
| machine (si vous êtes sous Mac OS ou Windows, vous aurez besoin de travailler avec l'IP de votre | ||
| machine virtuelle). | ||
|
|
||
| Si vous utilisez Docker, la base de donnée sera configurée automatiquement. |
| ->add('lastName', TextType::class) | ||
| ->add('emailAddress', EmailType::class) | ||
| ->add('emailAddress', EmailType::class, [ | ||
| 'empty_data' => '', |
There was a problem hiding this comment.
Bug fix, it activates the transformer null => '', see symfony/symfony#18357 :)
There was a problem hiding this comment.
not needed IMO =) (https://github.com/EnMarche/en-marche.fr/pull/80/files#r95741608)
| $this->gender = Genders::MALE; | ||
| $this->position = ActivityPositions::EMPLOYED; | ||
| $this->conditions = false; | ||
| $this->emailAddress = ''; |
There was a problem hiding this comment.
Bug fix when submitting null, prevents a fatal error.
There was a problem hiding this comment.
please edit the function signature to be consistent with the rest of code.
748da40 to
dab2b56
Compare
| use Symfony\Component\Debug\Debug; | ||
|
|
||
| if (isset($_SERVER['HTTP_CLIENT_IP']) || isset($_SERVER['HTTP_X_FORWARDED_FOR']) || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || php_sapi_name() === 'cli-server')) { | ||
| if ('docker' !== getenv('SYMFONY_ENV') && (isset($_SERVER['HTTP_CLIENT_IP']) || isset($_SERVER['HTTP_X_FORWARDED_FOR']) || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || php_sapi_name() === 'cli-server'))) { |
There was a problem hiding this comment.
SYMFONY_ENV is usually a reference to a Symfony environment, and the docker environment is not a valid Symfony environment. I think we should use a different env var name.
There was a problem hiding this comment.
@tgalopin Fair enough, what about DOCKER_ENV=1?
|
@hhamon Final review? :) |
HeahDude
left a comment
There was a problem hiding this comment.
Needs work here. I should upgrade the readme to explain more how to launch the server.
| all: boot install assets run | ||
| .PHONY: clean | ||
|
|
||
| all: boot install db assets run |
There was a problem hiding this comment.
run is broken with Docker.
| - "3306:3306" | ||
|
|
||
| mailcatcher: | ||
| ports: |
There was a problem hiding this comment.
Mailcatcher can be removed, we are using mailjet directly without SMTP.
|
|
||
| mysql: | ||
| image: mariadb | ||
| environment: |
There was a problem hiding this comment.
why did you remove these default values ? there is no gain to put them in the override file.
| mailcatcher: | ||
| image: schickling/mailcatcher | ||
| ports: | ||
| - "9025:1025" |
There was a problem hiding this comment.
same here.
actually your docker-compose env, should be able to run without the override file. the override file will be used only by devs who want to tweak some stuffs
| $this->gender = Genders::MALE; | ||
| $this->position = ActivityPositions::EMPLOYED; | ||
| $this->conditions = false; | ||
| $this->emailAddress = ''; |
There was a problem hiding this comment.
please edit the function signature to be consistent with the rest of code.
| use Symfony\Component\Debug\Debug; | ||
|
|
||
| if (isset($_SERVER['HTTP_CLIENT_IP']) || isset($_SERVER['HTTP_X_FORWARDED_FOR']) || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || php_sapi_name() === 'cli-server')) { | ||
| if ('1' != getenv('DOCKER_ENV') && (isset($_SERVER['HTTP_CLIENT_IP']) || isset($_SERVER['HTTP_X_FORWARDED_FOR']) || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || php_sapi_name() === 'cli-server'))) { |
| ->add('lastName', TextType::class) | ||
| ->add('emailAddress', EmailType::class) | ||
| ->add('emailAddress', EmailType::class, [ | ||
| 'empty_data' => '', |
There was a problem hiding this comment.
not needed IMO =) (https://github.com/EnMarche/en-marche.fr/pull/80/files#r95741608)
|
I've just updated this PR. Still need to do :
|
| $(CONSOLE) cache:clear --no-warmup | ||
| $(CONSOLE) cache:clear --no-warmup --env=prod | ||
| $(CONSOLE) cache:clear --no-warmup --env=test | ||
| $(APP) rm -rf var/logs/* |
There was a problem hiding this comment.
This deletes .gitkeep files :/
| @@ -19,8 +21,8 @@ services: | |||
|
|
|||
| mailcatcher: | |||
There was a problem hiding this comment.
missing a rebase on master
| ou | ||
|
|
||
| - PHP 7.0+ | ||
| - PHP 7.1+ |
There was a problem hiding this comment.
Ok but maybe it's not a good idea to develop on 7.1 if we are requiring only 7.0?
https://github.com/EnMarche/en-marche.fr/blob/master/docker/tools/Dockerfile#L1
|
|
||
| ou | ||
|
|
||
| - PHP 7.1+ |
There was a problem hiding this comment.
Should be 7.0 to be iso prod.
|
LGTM 👍, thanks @romain-pierre :) |
| /app/data/images/* | ||
| !/app/data/images | ||
| !/app/data/images/.gitkeep | ||
| /app/data/images/ |
There was a problem hiding this comment.
Why remove the gitkeep? I like to be able to understand the directory structure of the project in git. This is true for the other directories like this one.
There was a problem hiding this comment.
It's just because using ! sign have no effect on the files already added in the Git index. I prefer to ignore an entire folder and manually add the .gitkeep file in the index (ie: added by force, regardless of the ignore list).
By this way, the folder and it's contents will always be ignored AND the folder will be created thanks to the .gitkeep file AND there is no useless line in the gitignore.
| - "3306:3306" | ||
|
|
||
| mailcatcher: | ||
| ports: |
There was a problem hiding this comment.
Mailcatcher can be removed, we are using mailjet directly without SMTP.
d051c2d to
88b6303
Compare
| - db | ||
| volumes: | ||
| - .:/var/www | ||
| - /var/www/var/cache |
There was a problem hiding this comment.
Hum, why put this and the sessions as a volume?
|
|
||
| <Directory /var/www/web> | ||
| Require all granted | ||
| DirectoryIndex app.php |
There was a problem hiding this comment.
Like you want, but personally I prefer to have the production bootstrap script when the user request http://127.0.0.1/ and manually specify http://127.0.0.1/app_dev.php/ for development.
There was a problem hiding this comment.
Please note that are the Symfony Standard htaccess rules.
There was a problem hiding this comment.
I prefer app_dev.php if you can change this, just to be easier for the newcomers.
| @@ -1,65 +0,0 @@ | |||
| daemon off; | |||
There was a problem hiding this comment.
Il faut pas supprimer ca, c'est utilisé pour la preprod.
There was a problem hiding this comment.
Ok, I will revert, but if we switch back to nginx in the future, this file will be located in a sub-folder (probably /docker/web/nginx.conf) to have a clear config.
There was a problem hiding this comment.
I'll work on this PR tonight.
There was a problem hiding this comment.
I've just updated. I will post some comments on the /Dockerfile.
|
For the Dockerfile (the production one):
|
|
That's true, I'm working on a new ubuntu 16.04 image, and I'll take your ideas into account. |
|
I changed quite a lot of things:
|
| ifdef DOCKER | ||
| APP=docker-compose exec -T app | ||
| TOOLS=docker-compose run --rm tools | ||
| APP=sudo docker-compose exec -T app |
There was a problem hiding this comment.
sudo is not required on every platforms for this command to works: on linux, user may be added in the docker group. And macOS not needs privilege elevation at all.
It's a "hard to resolve" point...
| php7.1-zip \ | ||
| supervisor \ | ||
| tzdata \ | ||
| wget && \ |
There was a problem hiding this comment.
Can you please add graphviz? We may need it to dump workflows as dot files.
51c664b to
25f27fc
Compare
|
👍 |
* Added a docker container for the application * Finalize Dockerized app
* Added a docker container for the application * Finalize Dockerized app
Uh oh!
There was an error while loading. Please reload this page.