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

Add support for using Docker for local development #3002

Merged
merged 15 commits into from Apr 25, 2019

Conversation

@patjouk
Copy link
Collaborator

commented Apr 11, 2019

This PR introduces support for using Docker for local development. How to use it is described in the README and the Docker for local dev documentation. Training for staff needs to be scheduled.

Moving to Docker will copy your existing .env to the .docker.env file that is in charge of managing env vars for Docker. You will get a new database populated with fake data: the setup task will invite you to create a new admin.

Run invoke docker-setup and give me feedback :)

Changes impacting everyone

  • Cypress unzipping was messing up output rendering with Docker, I moved the install as a separate npm command for now. It might change when this PR gets merged.,
  • Removed -f and -o flags from invoke commands: those were terrible, thanks past me! Use quotes instead ex: inv manage "load_fake_data --delete",
  • New invoke commands: if you don't want to use Docker, don't use the docker-X invoke tasks. All previous commands work as before.
  • Catch(-)up command alias: I've added an alias for the catch(-)up commands because I kept forgetting if it was a dash or not, and I guess I'm not the only one. Both invoke catchup and invoke catch-up will work.

Closes MozillaFoundation/Docker-foundation-site#7
Closes MozillaFoundation/Docker-foundation-site#6
Closes MozillaFoundation/Docker-foundation-site#4

Related PRs/issues MozillaFoundation/Docker-foundation-site#2, MozillaFoundation/Docker-foundation-site#1

@patjouk patjouk requested a review from cadecairos Apr 11, 2019

@cadecairos cadecairos temporarily deployed to foundation-mofostaging-pr-3002 Apr 11, 2019 Inactive

README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
@Pomax

This comment has been minimized.

Copy link
Collaborator

commented Apr 11, 2019

When running invoke docker-setup I eventually crash out with the error:

Creating foundationmozillaorg_watch-static-files_1 ... 
Creating foundationmozillaorg_postgres_1           ... error

Creating foundationmozillaorg_watch-static-files_1 ... done
r 0.0.0.0:5432 failed: port is already allocated

ERROR: for postgres  Cannot start service postgres: driver failed programming external connectivity on endpoint foundationmozillaorg_postgres_1 (04948c815f8024bd89af72600cbe40dd478d5223c3cae99a11bfb76dea540e0d): Bind for 0.0.0.0:5432 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.

Which makes sense, I have postgres installed because I need it for other things as well - probably worth seeing if we can port-detect and use a different port is 5432 is taken?

@patjouk patjouk temporarily deployed to foundation-mofostaging-pr-3002 Apr 15, 2019 Inactive

@patjouk patjouk temporarily deployed to foundation-mofostaging-pr-3002 Apr 15, 2019 Inactive

@patjouk

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 15, 2019

I updated docs and stop exposing postres port: that way, if postgres already run on the host, it won't fail anymore :)

edit: @cadecairos Can you check if the CHOKIDAR_USEPOLLING helps with the auto rebuild of static files?

docs/local_development_with_docker.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
docker-compose.yml Show resolved Hide resolved

@cadecairos cadecairos force-pushed the docker-local-dev branch from 371c391 to 2689a9f Apr 22, 2019

@patjouk patjouk changed the title [Need testing] Add support for using Docker for local development Add support for using Docker for local development Apr 24, 2019

@patjouk

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 24, 2019

@cadecairos Ready for a final review before merging.

patjouk added 2 commits Apr 24, 2019
@cadecairos
Copy link
Member

left a comment

Looks great, runs great. let's land it!

@patjouk patjouk merged commit b422098 into master Apr 25, 2019

3 of 4 checks passed

percy/foundation.mozilla.org 2 visual changes need review
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 75.109%
Details

@patjouk patjouk deleted the docker-local-dev branch Apr 25, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.