demo
demo copied to clipboard
Implement docker
This PR provides a Docker implementation for the Symfony Demo project. (based on https://github.com/mpiot/docker4symfony)
@javiereguiluz okay, I see many possibilities:
- implement MySQL and Yarn in docker (add SQLite to docker), keep build assets and the SQLite db
- replace MySQL by SQLite
- replace MySQL by SQLite, and remove yarn
I think the first proposal is better, then I also can add a comment in docker near the PDO extension ?
@mpiot I'm afraid I can't help you because I don't know much about Docker. But others will read this and will help you.
In any case, the basic premise is: we can do anything inside Docker ... but we can't change anything in the existing app.
@javiereguiluz I've fix it :-) I've just keep a Doctrine Migration file, then if a user want to use MySQL he can execute the migration.
Thanks a lot for reworking this. To me it's OK because it doesn't change the existing app ... but I 'll let Docker experts review it before merging. Thanks.
@voronkovich I've fixed some parts, as mentioned above, I've forget some parts (I use files from a personnal project).
I've removed MySQL part, indeed, it's simpler whithout all theses commented parts. I've keep the Makefile db part too, but maybe we can remove it ?
@voronkovich In the makefile the make tty use docker-compose exec then we don't need to add -it options.
I wait some other coments for this part, make tty, make bash or make terminal ?
I wait some other coments for this part, make tty, make bash or make terminal ?
make shell
@jkufner why not, now: 3 persons => 3 choices :-)
make shell sounds nice to me too.
This is ok, I've rename the tty part in shell :-)
What do you think about the naming for the php-cs-fixer part ? Because we name lint-yaml, lint twig, lint xliff, why not lint php ?
I'm pretty divided about it.
Test fails because there is a vulnerability (Twig 2.7 required, but it will be fixed when #955 is merged)
At the moment, I've no updates used versions. Then maybe before merge, say it to me to define last versions. (PHP, node, composer, etc...)
@athlan I've added a .dockerignore file.
You want to install composer in vendor-builder that extend app, that's it ?
Then we install composer in the app-dev and vendor-builder ?
That's possible, but, I'm not totally convinced. Because at the moment on some projects, I've never had a problem on vendor install because a php extension missed.
Le ven. 2 août 2019 à 17:01, Piotr Pelczar [email protected] a écrit :
@athlan commented on this pull request.
In Dockerfile https://github.com/symfony/demo/pull/931#discussion_r310171951:
+##################################### +## PROD ASSETS BUILDER ## +##################################### +FROM node:${NODE_VERSION} as assets-builder + +COPY . /app +WORKDIR /app + +RUN yarn install && yarn build && rm -R node_modules + +##################################### +## PROD VENDOR BUILDER ## +##################################### +FROM composer:${COMPOSER_VERSION} as vendor-builder
Yes yes, that's why my proposal is to have it only on vendor-builder:
FROM app as vendor-builder
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/symfony/demo/pull/931?email_source=notifications&email_token=ACPYEBAJTASX2GSEESAG3LTQCRD2XA5CNFSM4GPUSSRKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCANWQQQ#discussion_r310171951, or mute the thread https://github.com/notifications/unsubscribe-auth/ACPYEBEDIQATD37X7FRGEA3QCRD2XANCNFSM4GPUSSRA .
The project already encourages to use the Symfony binary, either to create the project or to launch the local server. Why not use the advantages it offers with Docker integration (https://symfony.com/doc/current/setup/symfony_server.html#docker-integration)?