Our default release pipeline is enabled for this repository. Merge to deploy to stage; Release/tag to deploy to production.
Standalone mjml server, listening on port 8080/tcp.
Due to various challenges this image sports the following features:
- Clean and fast shutdowns on docker.
- Simple CORS capabilities.
- Small footprint (at least in a npm way).
- Supports healthchecks.
This image spools up a simple mjml server instance, listening to port 8080/tcp per default.
Due to GDPR / DSGVO reasons I required the mjml instance to be under my own control, as the processing personal information is processed in mail content generation.
Starting the image is as easy as running a test instance through docker
docker-compose up
cd test
curl --data "@raw.mjml" http://localhost:8080
The production defaults, without any override, default to:
CORS=""
MAX_REQUEST_BODY="2048kb"
MJML_KEEP_COMMENTS="false"
MJML_VALIDATION_LEVEL="soft"
MJML_BEAUTIFY="false"
HEALTHCHECK="true"
CHARSET="utf8"
DEFAULT_RESPONSE_CONTENT_TYPE="text/html; charset=utf-8"
For development environments I would suggest to switch it to
CORS="*"
MJML_KEEP_COMMENTS="true"
MJML_VALIDATION_LEVEL="strict"
MJML_BEAUTIFY="false"
HEALTHCHECK="false"
This will escalate any issues you have with invalid mjml code to the docker log (stdout
or docker-compose logs
).
Make sure you pass along a plain Content-Type header and pass the mjml as raw body.
Catch errors by looking at the HTTP response code.
As the default Dockerfile specific HEALTHCHECK
directive is not supported by kubernetes, you might need to specify your own probes:
spec:
containers:
- name: ...
livenessProbe:
exec:
command:
- curl - 'http://localhost:8080/health/liveness'
initialDelaySeconds: 30
periodSeconds: 30
readinessProbe:
exec:
command:
- curl - 'http://localhost:8080/health/readiness'
initialDelaySeconds: 25