This ticket is about replacing the directory-based "atomic deployment" mechanism for the FundraisingFrontend with a container-based mechanism, while keeping the migration effort as low as possible.
- A multi-stage Dockerfile in https://github.com/wmde/fundraising-frontend-docker that builds a self-contained version of the FundraisingFrontend. Pay attention to the order of steps to speed up the build process when vendors and node_modules did not change, leveraging the build cache.
- Run composer install --no-dev --optimize-autoloader (and, if necessary copy the vendors directory into the Docker image)
- Run make install-js and make ui (or equivalent commands in a Docker build stage) and copy the compiled client-side code into the docker image. node_modules MUST NOT be part of the deployable Docker image!
- Copy the source code into the image
- Infrastructure repository contains a docker-compose.yml file for the FundraisingFrontend. The file is started as a systemd service. To lower the effort, we'll reuse the existing nginx and logging infrastructure, so the configuration should
- Expose the application on Port 9000 (to match the existing nginx configuration)
- mount the var directory from the host
- Mount the configuration file for the desired environment into the image
- set the APP_ENV variable to match the configuration file
- Atomic deploy playbook for content is adapted for docker volumes: Symlinks can't be mounted into docker containers, so maybe use hard links
- Modify server setup playbook: remove PHP-related installation steps, add Docker and docker-compose installation
- Naming/labeling schema for the Docker image builds
Not part of this ticket
- Automated build of Docker Image
- Automated deploys
- Environment is the same for development and production
- Faster Deployments and rollbacks (start containers based on different images)