-
Notifications
You must be signed in to change notification settings - Fork 32
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
Docker support #34
Merged
Docker support #34
Conversation
This file contains 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
Closed
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.
Description
Adds Docker support. Useful for local development and running tests, but not (yet) for production serving. Tested on MacOS and Windows.
Rationale
12+ years on, Flamework remains the best option for quickly doing PHP projects. However, there's a lot of work to be done to bring this codebase up to modern PHP syntax and cloud hosting options. Before I started working on those I wanted a checkpoint for running tests that's not Vagrant (since Vagrant doesn't run natively on Apple silicon). Once the upgrades are done, the goal would be to make the docker container deployable by stripping down to just the PHP runtime (and Flamework code changes to support that).
The Now
This is mostly a port of the existing Vagrant scripts into Docker. It installs PHP 5.5.9, Apache 2.4.7, memcached 1.4.14, and MySQL 5.5.62. It looks like the version most-recently tested was PHP 5.4, but 5.5 was easy to find and runs cleanly.
All the daemons are all started in a single container, and basic SSL is configured. Enough config is put in place to connect to the database, but secrets need to be set to actually do login and set cookies. The SSL config is so ancient that modern browsers reject it outright and don't allow you to override, thus no auto-HTTPS upgrades are done.
If no
flamework
database is in place at container runtime, it is created. DB persistence is optional with Docker volumes, but otherwise wiped between runs to make test runs cleaner. Code is mounted from a volume so that live code editing can be supported.Reasons not to use this in production (yet)
memcached
,mysql
, andapache2
in a single container (containers shouldn't run more than one daemon at a time)The Future
Immediate work will be around adding more tests to exercise the existing code. Then PHP will be brought up to the most modern versions, which will involve at the very least removing
mcrypt
and upgrading Smarty (this is where more tests will be handy).Additional goals in my head:
ticketd
replacement solution.Other changes
make docker
target addedREADME
notes on using the Docker image.gitattributes
set toeol=lf
for shell scripts, since WSL (and therefore Docker on Windows) required it