Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

Add new Docker images for MARTI development #4

Merged
merged 1 commit into from
Dec 1, 2017

Conversation

ssoloff
Copy link
Member

@ssoloff ssoloff commented Dec 1, 2017

This PR adds a new set of Docker images for MARTI development. The purpose of using the new images is to be able to test MARTI changes in an environment that more closely matches production on dice.tripleawarclub.org.

The most significant changes from the old Docker environment are the following:

  • Uses Nginx instead of Apache.
  • Uses the exact versions of Nginx, PHP, and MySQL used in production.
  • Runs each component in a separate container (via Docker Compose).
  • Uses SSMTP instead of Postfix as the mail relay. This differs from production but was done to make the images easier to maintain. However, we will probably revert back to using Postfix in the future.

The old Docker environment was moved to a new folder (marti-dev-old). I intend to remove it in a future PR once I'm sure there's no issues with the new Docker environment.

Note also that the previously Docker-specific DB scripts have now been promoted to formal configuration-managed artifacts as we do with the lobby DB. It's possible we will need to make changes to the DB to properly handle triplea-game/triplea#2603, and this prepares us for running DB migration scripts. (Although the current 0000 script does not match production, and it will need to be updated in a forthcoming PR.)

This PR contains no changes to the MARTI code.

The new configuration more closely matches production by using Nginx
instead of Apache.  It also uses the exact versions of Nginx, PHP-FPM,
and MySQL used in production.

One change from production is that it uses SSMTP instead of Postfix as
the mail relay.  See [1] and [2] for helpful SSMTP references.

[1] https://binfalse.de/2016/11/25/mail-support-for-docker-s-php-fpm/
[2] https://wiki.archlinux.org/index.php/SSMTP
Copy link
Member

@RoiEXLab RoiEXLab left a comment

Choose a reason for hiding this comment

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

LGTM although I must admit my experience with docker is pretty much 0
So it would be nice if someone with slightly more experience could have a look

`email` varchar(255) NOT NULL,
`validation_key` char(32) NOT NULL,
`time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`IP` int(10) unsigned NOT NULL,
Copy link
Member

Choose a reason for hiding this comment

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

Are you going to create a 0001 file to remove this column?

Copy link
Member Author

Choose a reason for hiding this comment

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

Most likely. However, I'm probably going to submit a short-term fix that simply hardcodes IP to zero in the PHP code to get IPv6 working as quickly as possible without having to schedule downtime to migrate the DB.

AuthMethod=LOGIN
FromLineOverride=yes
UseSTARTTLS=Yes
UseTLS=Yes
Copy link
Member

Choose a reason for hiding this comment

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

Could become problematic, although postfix etc. have a self signed certificate as a default certificate this will likely cause issues if not preconfigured manually.

Copy link
Member Author

Choose a reason for hiding this comment

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

This option simply requires TLS when opening a connection from this host (i.e. dice.tripleawarclub.org) to the external mail relay specified in the mailhub option. SSMTP does not run a local mail relay--it is purely an SMTP client:

SSMTP is a program which delivers email from a local computer to a configured mailhost (mailhub). It is not a mail server (like feature-rich mail server sendmail) and does not receive mail, expand aliases or manage a queue.

It would be nice if we could drop Postfix in production. The new dice server will most likely use a Node SMTP module that does not require an external mail application like PHP does. Does anything else on that host require a mail server to be running?

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the clarification.
NodeBB does indeed not require a the postfix sendmail application, we can (and probably have to) use nodemailer, but if we want to have our own email domain we still need a dedicated mail server at some point (although I'd prefer having a mail server hosted for us so we don't have to worry about it, but DanVanAtta disagreed, because, well more expenses that can be avoided)

@RoiEXLab
Copy link
Member

RoiEXLab commented Dec 1, 2017

Given your clarification, and looking through the diff again, I think this change is fine, it doesn't really matter now until we actually use this repo in production

@RoiEXLab RoiEXLab merged commit 3800ada into triplea-game:master Dec 1, 2017
@ssoloff ssoloff deleted the new-docker-dev-images branch December 1, 2017 20:12
@ssoloff ssoloff mentioned this pull request Dec 2, 2017
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants