Add Docker local development environment#1
Open
WilliamsJason wants to merge 3 commits intopnwinsects:masterfrom
Open
Add Docker local development environment#1WilliamsJason wants to merge 3 commits intopnwinsects:masterfrom
WilliamsJason wants to merge 3 commits intopnwinsects:masterfrom
Conversation
- Dockerfile using python:2.7 with all dependencies - docker-compose.yml for one-command startup - SQLite database (no MySQL needed locally) - Auto-initializing entrypoint script (syncdb + migrate) - Stub modules for unavailable packages (admin_sentry, csvimporter, csv_admin) - Static/media file serving via urls_docker.py - Login requirement exempted for local browsing Usage: docker-compose up --build docker-compose exec web python manage.py createsuperuser Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Switch from SQLite to MySQL 5.6 container matching production server - Add mysqlclient to requirements, default-libmysqlclient-dev to Dockerfile - docker-compose.yml now starts MySQL service with auto-import from data/ - Entrypoint waits for MySQL readiness, detects pre-loaded SQL dump - Settings use environment variables for DB config (DB_HOST, DB_NAME, etc.) - Add data/ to .gitignore (SQL dumps are large, not committed) - Include zzz-local-fixes.sql to fix CMS page permissions for local dev Place stripped SQL dump in data/pnwmoths-local.sql, then: docker-compose up --build Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rainhead
reviewed
Mar 21, 2026
rainhead
left a comment
There was a problem hiding this comment.
Thanks for getting this going! I tried it as far as seeing that docker compose up was successful.
Comment on lines
+1
to
+12
| FROM python:2.7 | ||
|
|
||
| # Fix apt sources — Debian Stretch is archived | ||
| RUN sed -i 's|deb.debian.org|archive.debian.org|g' /etc/apt/sources.list && \ | ||
| sed -i 's|security.debian.org|archive.debian.org|g' /etc/apt/sources.list && \ | ||
| sed -i '/stretch-updates/d' /etc/apt/sources.list 2>/dev/null; \ | ||
| apt-get update && apt-get install -y --no-install-recommends \ | ||
| libjpeg-dev \ | ||
| zlib1g-dev \ | ||
| libfreetype6-dev \ | ||
| default-libmysqlclient-dev \ | ||
| && rm -rf /var/lib/apt/lists/* |
There was a problem hiding this comment.
ubuntu:22.04 supports Python2.7 and gets security updates. Would that work better?
| @@ -0,0 +1,49 @@ | |||
| services: | |||
| db: | |||
| image: mysql:5.6 | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Docker-based local development setup so developers can run the site with a single command.
What's included
Quick start