Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: add new docker for production & development environment #31

Merged
merged 1 commit into from
Oct 31, 2020
Merged

Feat: add new docker for production & development environment #31

merged 1 commit into from
Oct 31, 2020

Conversation

toofff
Copy link
Contributor

@toofff toofff commented Sep 26, 2020

  • add new docker-compose.yml & Dockerfile layer divisions
    • service php & configuration (env PROD & DEV)
      • use php:74-fpm-alpine
      • add docker-healthcheck
      • update docker-entrypoint
        • use php.ini PROD or DEV
        • create important folders for the use of the project (public/files, public/theme, public/thumbs, var/cache, var/log & var/sessions)
        • install vendor for development environment
        • test BDD is active
        • use php bin/console bolt:info instead of launching after installing vendors (because it is looking for the version of the database which might not be launched in time)
        • if the theme does not exist, it will copy it
        • if this project use DoctrineMigrationBundle then launch migrations (all env) else reset & create schema (only env DEV & TEST)
        • launch fixtures
    • service nginx & configuration (env PROD & DEV)
      • copy public folder of php container
    • service db with MySQL 5.7 version (only env DEV)
    • service h2-proxy to have SSL (only env DEV)
    • service mailcatcher to do (only env DEV)
  • add .dockerignore file
  • add .editorconfig file
  • replace .env.dist by .env file, to respect symfony's good practice
  • rework the .gitignore file
  • rework the Makefile file
  • rework the README.md file
  • rework the composer.json file & update dependencies
    • bolt/core 4.0.1
    • bolt/themes 3.3.2
  • update the symfony.lock file
  • fix the use of API-Platform
    • the configuration (add path %kernel.project_dir%/src/Entity for the use of our own entity)
    • install assets with the copy file
  • add dev dependency for ECS & PHPStan
  • upgrade documentation
  • rework commit in pull request

I added a CI for the installation of a Bolt project with Composer or Docker Compose.

The continuous integration is not yet working on this pull request because nothing is merged into the Bolt repository yet in my opinion. On the other hand you can see it working on my pull request in my fork

Copy link
Member

@bobdenotter bobdenotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't use Docker myself, but I know a lot of people do, so it's great if this is updated thoroughly. :-)

Some questions about the first things I noticed, but you might still be working on this:

  • I see you've removed a few files (.gitignore's, .env.dist). Is this on purpose?
  • We're keeping our version of PHP in sync with Symfony. So, we'll need to make sure the 7.4 in symfony.lock won't break that requirement.

@toofff
Copy link
Contributor Author

toofff commented Sep 27, 2020

  • Yes I deleted the .gitignore file in the public folder. I prefer to have the project rules at the root but above all it forces you to have server rules so that this file is not accessible in production if it is forgotten during deployment.

  • Yes I deleted the .env.dist file in the root project. Here are the new specs on this file since Symfony / flex and Symfony 5

  • For PHP 7.4 it is a proposal, I can downgrade if you wish? Even though I personally prefer to be on the last minor version of the 7.x branch for creating a new project.

I'm glad you welcome this work like this. I still have some work to do but you can already test it with a simple docker-compose up. Everything is functional at home.

If you have more proposals, I am interested ;)

@toofff
Copy link
Contributor Author

toofff commented Sep 28, 2020

@bobdenotter

Little question, do you know why we had a "node" container in the docker?

Great news, I think I finished it all this week. Don't hesitate to test and give feedback ;)

@bobdenotter
Copy link
Member

Little question, do you know why we had a "node" container in the docker?

No, i'm afraid I don't.. I don't really use Docker myself.

Perhaps @JarJak (🛎️) knows?

@toofff
Copy link
Contributor Author

toofff commented Oct 7, 2020

@bobdenotter I still have the documentation to finish, I hope to deliver it to you this week for the review 😄

@bobdenotter
Copy link
Member

@toofff Excellent! Looking forward to it!

@toofff toofff marked this pull request as ready for review October 8, 2020 07:26
@toofff
Copy link
Contributor Author

toofff commented Oct 8, 2020

@bobdenotter Now I pass the torch to you for proofreading and testing locally. I remain at your disposal for any questions and changes to be made. :)

@bobdenotter
Copy link
Member

@toofff Thanks!

It'll take me a little while to review, because I'd like to do it with care. Will let you know if any questions arise.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
index.php Outdated Show resolved Hide resolved
public/.htaccess Outdated Show resolved Hide resolved
@simongroenewolt
Copy link
Contributor

Little question, do you know why we had a "node" container in the docker?

I don't know if you still have this question, but I think the node container is to build/process the javascript for the (vue based) editor support in /bolt

@toofff
Copy link
Contributor Author

toofff commented Oct 11, 2020

Thanks @simongroenewolt I'm watching this this week.

@toofff
Copy link
Contributor Author

toofff commented Oct 12, 2020

@simongroenewolt @bobdenotter

For me the container node is not necessary here. From what I could understand, this container is only needed for "bolt/assets" development. So not necessary for end developers who will develop websites with "bolt/project"

@toofff
Copy link
Contributor Author

toofff commented Oct 17, 2020

@bobdenotter did you have time to test with and without docker?

docker-compose.yml Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
@toofff toofff mentioned this pull request Oct 22, 2020
29 tasks
@bobdenotter
Copy link
Member

@toofff Is this 'good to go' for now? If so, we'll merge it in shortly, and we fine-tune it before release of a new version of this repo.

@toofff
Copy link
Contributor Author

toofff commented Oct 29, 2020

I try to finalize tomorrow and do my rebase so that it is mergeable

@toofff
Copy link
Contributor Author

toofff commented Oct 29, 2020

@bobdenotter It's good for me, I made the last corrections of the CI, the rebase of the master branch, the update of composer 2.

You can test by following the README.md file and merge if you like.

If you want to view the CI, it is available on my fork

public/index.php Outdated Show resolved Hide resolved
Copy link

@JKetelaar JKetelaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has my blessing

- Add CI with github action for Composer 2 & Docker Compose installation
- Upgrade project with Composer 2
- Rework the docker services for devlopment environment (php, nginx, db, h2-proxy & mailcatcher)
- Replace .env.dist by .env
- Add the .editorconfig file
- Add the .dockerignore file
- Rework the .gitignore file
- Rework the Makefile file
- Rework the README.md file
- Fix API Platform usage
- Upgrade dependencies of project
- Fix the project configuration after launch composer sync-recipes
- Add in require dev & fix configuration (to get closer to symfony requirements) for Easy Coding Standard
- Add in require dev & fix configuration for PHPStan
Copy link
Member

@bobdenotter bobdenotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As previously discussed: Let's roll with this, and iron out kinks as we go!

🚂 🚋 🚋

@bobdenotter bobdenotter merged commit a05350e into bolt:master Oct 31, 2020
@toofff toofff deleted the feature/add-new-docker branch November 3, 2020 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants