Skip to content

Commit c721997

Browse files
committed
Update docs
- Move image to build->tags in docker-compose - Add custom docker-compose for CI (Avoid re-build in CI)
1 parent 29ff992 commit c721997

File tree

4 files changed

+29
-7
lines changed

4 files changed

+29
-7
lines changed

.github/docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
serve:
3+
image: $DOCKER_IMAGE
4+
build: !reset null
5+
env_file: !reset null
6+
environment:
7+
CI: "true"
8+
DJANGO_SECRET_KEY: RANDOM-STRING-FOR-SECRET-KEYS

.github/workflows/ci.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ on:
1919
pull_request:
2020
# NOTE: For develop & master, they are run through helm github action ./build-publish-docker-helm.yml
2121

22+
env:
23+
COMPOSE_FILE: docker-compose.yml:.github/docker-compose.yml
2224

2325
jobs:
2426
pre_commit_checks:
@@ -103,28 +105,38 @@ jobs:
103105
cache-to: type=gha,mode=max
104106

105107
- name: Docker config setup & Pull docker images
108+
env:
109+
DOCKER_IMAGE: ${{ steps.prep.outputs.tagged_image }}
106110
run: |
107-
cp .env-sample .env &&
111+
touch .env
108112
docker compose run --rm serve ls
109113
110114
- name: 🕮 Validate if there are no pending django migrations.
115+
env:
116+
DOCKER_IMAGE: ${{ steps.prep.outputs.tagged_image }}
111117
run: |
112118
docker compose run --rm serve ./manage.py makemigrations --check --dry-run || {
113119
echo 'There are some changes to be reflected in the migration. Make sure to run makemigrations';
114120
exit 1;
115121
}
116122
117123
- name: 🕮 Validate SentryMonitor config
124+
env:
125+
DOCKER_IMAGE: ${{ steps.prep.outputs.tagged_image }}
118126
run: |
119127
docker compose run --rm serve ./manage.py cron_job_monitor --validate-only || {
120128
echo 'There are some changes to be reflected in the SentryMonitor. Make sure to update SentryMonitor';
121129
exit 1;
122130
}
123131
124132
- name: Run django migrations
133+
env:
134+
DOCKER_IMAGE: ${{ steps.prep.outputs.tagged_image }}
125135
run: docker compose run --rm serve ./manage.py test --keepdb -v 2 --pattern="test_fake.py"
126136

127137
- name: 🤞 Run Test 🧪
138+
env:
139+
DOCKER_IMAGE: ${{ steps.prep.outputs.tagged_image }}
128140
run: docker compose run --rm serve pytest --reuse-db --durations=10
129141

130142
- name: 🐳 Docker push

docker-compose.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# NOTE: Used Only for local development
22

33
x-server: &base_server_setup
4-
image: ifrcgo/go-api:uv-latest
5-
build: .
4+
build:
5+
context: .
6+
tags:
7+
- ifrcgo/go-api:latest
68
# To attach to container with stdin `docker attach <container_name>`
79
# Used for python debugging.
810
stdin_open: true

docs/playwright-exports.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ DEBUG_PLAYWRIGHT=True
1212
Start or update containers with:
1313
```bash
1414
# In the background
15-
docker compose up -d serve celery
15+
docker compose up -d serve celery playwright
1616

1717
# In the foreground - Use this to view Playwright logs
18-
docker compose up serve celery
18+
docker compose up serve celery playwright
1919
```
2020

2121
## Frontend
@@ -24,7 +24,7 @@ For setup instructions, refer to: https://github.com/IFRCGo/go-web-app/?tab=read
2424

2525
**We need two instances of the go-web-app:**
2626
1. For the host system (browser) on port 3000.
27-
2. For Celery workers (Playwright browser) on port 3001.
27+
2. For playwright container on port 3001.
2828

2929
To start the regular go-web-app:
3030
```bash
@@ -36,4 +36,4 @@ For the additional go-web-app instance for Playwright:
3636
APP_API_ENDPOINT=http://host.docker.internal:8000/ pnpm start:app --host --port 3001
3737
```
3838
> [!IMPORTANT]
39-
> The backend will be available at `host.docker.internal:8000` inside the Playwright container running within Celery.
39+
> The backend will be available at `host.docker.internal:8000` inside the Playwright container.

0 commit comments

Comments
 (0)