0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00
Commit graph

11 commits

Author SHA1 Message Date
Chris Raible
ebc75f79bf
Removed unused environment variable from compose.yml (#22134)
no issue

- I had plans to use this environment variable for the docker compose
setup, but haven't implemented anything with it yet — removing it for
now since it's not doing anything at the moment.
2025-02-06 13:05:40 -08:00
Chris Raible
1b2e121165
Fixed flaky browser tests for scheduling posts (#22122)
no issue

- The browser tests for scheduling posts were flaking/failing because
the time was set to `00:00`, which is invalid and should reset the time
to "a few seconds from now", but the test was sometimes able to
"Continue" before the validation logic could run on blur. This left the
actual scheduled time set to `00:00`, which then caused the following
assertions to fail.
- I've tried to replicate this race condition manually to confirm it's
not a bug that a user could actually reach, but I haven't been able to.
I suspect that playwright's `.fill()` and/or `.click()` method behave
slightly differently than expected, which creates this race condition.
2025-02-05 19:56:07 -08:00
Chris Raible
049dba469f
Added support for portal & other apps in containerized Ghost (#22121)
no issue

- The `yarn dev` command accepts dash-dash-args to conditionally build &
run other apps, like portal, comments, etc.
- Passing these flags to the docker compose setup directly doesn't work,
so the only way to run these apps in docker was to either change the
command in the Dockerfile or override the command in the `compose.yml`
file
- This commit extends `yarn dev` to also check for the
`GHOST_DEV_APP_FLAGS` environment variable for these flags, which can be
forwarded into the container and make it easier to run these apps using
docker compose.
2025-02-05 18:18:58 -08:00
Chris Raible
5631e804b6
Added service_healthy condition for mysql and redis (#22119)
no issue

- Ghost would sometimes crash because it was booting before the database
service was ready (even if the container had already started). This
commit tells `docker compose` to only start the ghost service once the
`mysql` and `redis` services have passed their health checks
2025-02-05 15:45:00 -08:00
Chris Raible
40e242da71
Removed env_file from compose.yml (#22104)
no issue

- With the `package.json` commands specifying the `COMPOSE_PROFILES`
environment variable, this `env_file` block is no longer needed.
- Worse yet, it throws an error if the `.env` file it points to does not
exist, which is really annoying.
2025-02-04 01:24:26 +00:00
Chris Raible
d4bf982392
Fixed hot reload for admin in docker compose (#22059)
no issue

- Hot reload for admin depends on the browser being able to reach port
4201, which was not exposed in the docker compose setup — this fixes
that so admin will hot reload when running Ghost in docker compose
2025-01-28 06:06:53 +00:00
Chris Raible
0c56c9bb8f
Fixed browser tests running in docker compose (#21974)
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.
2025-01-07 20:03:39 -08:00
Chris Raible
c1f9740665
Added opt-in ghost service to docker compose (#21938)
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.
2025-01-07 14:16:43 -08:00
Chris Raible
d275395c1f
Added redis data volume to compose setup (#21906)
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).
2024-12-17 13:14:21 -08:00
Chris Raible
cabee005f4
Consolidated compose.yml files for Dev Container (#21659)
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.
2024-12-17 12:57:02 -08:00
Chris Raible
05127ddc5c
Reorganized docker related files (#21650)
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)