ref
https://linear.app/ghost/issue/ENG-1968/get-browser-tests-working-in-docker
- When running browser tests in docker compose, the `stripe listen`
command was not outputting the API key from the environment, because
it's expecting that you've already run `stripe login` to authenticate
with stripe. It only outputs the API key in the command line in CI.
- This isn't convenient/practical to do in docker, and it's much easier
to supply the API key as an environment variable, so this changes the
logic to use the API key from the command line when running in docker
_or_ CI.
ref
https://linear.app/ghost/issue/ENG-1957/add-ghost-service-to-base-docker-compose-setup
- Currently our `compose.yml` file only runs Ghost's supporting
services, and it's expected that you'll run Ghost locally on your host
machine. This commit adds a `ghost` service to our `compose.yml` file,
so you can optionally run Ghost itself in a container using docker
compose.
- The `ghost` service is opt-in using [docker compose
profiles](https://docs.docker.com/compose/how-tos/profiles/), to
maintain the current behavior of only running supporting services as the
default.
- This commit also fixes an issue in the Dockerfile: the `WORKDIR` arg,
which is used to optionally specify an alternative working directory, is
not propagated from one build stage to the next, so it has to be
manually added as an `ARG` in each stage. This was necessary to use the
same Dockerfile for devcontainers (which require the WORKDIR to be
`/workspaces/ghost`) and docker compose, where we use `/home/ghost` in
alignment with the production image.
ref
https://linear.app/ghost/issue/ENG-1956/redis-creates-new-anonymous-volume-each-time-it-boots
- Before this commit, the redis service in our docker compose setup
would create a new anonymous volume each time it boots, with a
non-descriptive, hash-based name. Over time these volumes accumulate and
become a pain to clean up, and it's not immediately obvious what they
are used for.
- This commit adds a persistent data volume for redis data, so it will
reuse the same volume, with a more descriptive title each time it boots.
This eliminates the annoying anonymous volumes, and also gives us data
persistence across boots for the redis service (which can be easily
cleared by deleting the volume).
ref
https://linear.app/ghost/issue/ENG-1785/consolidate-dev-container-composeyml-with-the-root-level-composeyml
- We currently have two compose.yml files:
- `.devcontainer/compose.yml`: used for the Dev Container
- `compose.yml`: used for local development with docker compose
- The Dev Container compose file does need some additional
configuration, but most of this code is duplicated from the root level
compose.yml file
- This commit removes this duplication by using both compose files in
the Dev Container setup, so it will base the compose configuration on
the root level, and then extend it with the Dev Container specific
configuration
- This way any updates to the root level compose file will also be
available and reflected in the Dev Container setup without having to
make the change twice.
ref https://linear.app/ghost/issue/ENG-1782/move-docker-related-files-to-a-better-location-that-githubscripts
- The docker files are currently located in `.github/scripts`. This location doesn't make a lot of sense — you wouldn't think to look there unless you already knew they were there. This also requires you to specify the path to the `compose.yml` file whenever running a `docker compose ...` command.
- This commit moves the `compose.yml` file to the root of the repo, so you can simply run `docker compose up` and it will automatically find the file in the root, without having to specify `-f .github/scripts/docker-compose.yml`. This is a major win for convenience over the current setup.
- It also moves all the related files, including the `Dockerfile` used by the Dev Container setup and configuration files for supporting services into a new `.docker` directory, which is a more logical location, and should be easier to find.
- Also updated the current convenience commands in the `package.json` scripts block (`yarn docker:reset` and `yarn docker:down`
2024-11-19 13:15:06 -08:00
Renamed from .github/scripts/docker-compose.yml (Browse further)