Skip to content

Commit 6bed7be

Browse files
authored
Merge pull request #494 from mozilla-services/matt-boris/multipleFixes
chore: fix some heroku build errors
2 parents 5d06401 + 1f53da2 commit 6bed7be

6 files changed

Lines changed: 20 additions & 123 deletions

File tree

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,29 @@ queues. More information on [the wiki][].
1111
* Python 3.13+
1212
* pip or [uv](https://docs.astral.sh/uv/) (to install dependencies)
1313
* PostgreSQL (for production; testing environments can use sqlite)
14-
* docker-compose (to stand up a local Docker-based environment)
14+
* docker (to stand up a local Docker-based environment)
1515

1616
## Setup
1717

1818
### Docker Compose
1919

2020
The easiest way to start a local instance of PulseGuardian is via
21-
[docker-compose][]:
21+
[docker compose][]:
2222

23-
$ docker-compose up --build
23+
$ docker compose up --build
2424

2525
This will launch four containers: a RabbitMQ instance, a PostGreSQL database,
2626
the PulseGuardian web process, and the PulseGuardian daemon
2727
(`guardian.py`). Pressing control-C will stop all the containers.
28-
You can also add `-d` to run docker-compose in the background, in
29-
which case you will need to run `docker-compose down` to stop the containers.
28+
You can also add `-d` to run docker compose in the background, in
29+
which case you will need to run `docker compose down` to stop the containers.
3030

3131
Known issue: a local install of PostGreSQL will likely result in a port
3232
conflict.
3333

3434
The PulseGuardian code is mounted as `/code` in the web and daemon
3535
containers. You can edit the code locally and restart the container(s) to
36-
pick up changes: `docker-compose restart web` and/or `docker-compose
36+
pick up changes: `docker compose restart web` and/or `docker compose
3737
restart guardian`. The RabbitMQ cluster and PulseGuardian database data are
3838
preserved across restarts as via Docker volumes.
3939

@@ -155,7 +155,7 @@ For production, the web app can be run with [gunicorn][] and such.
155155
## Testing
156156

157157
TODO: This process should be updated to run the tests with a
158-
docker-compose environment.
158+
docker compose environment.
159159

160160
Tests are automatically run against the GitHub repository via [Travis
161161
CI][]. Before submitting a patch, it is highly recommended that you
@@ -165,7 +165,7 @@ pulseguardian repo.
165165
For local testing, PulseGuardian uses docker to run its test
166166
suite. Please follow the [docker installation docs][] on how to
167167
install it in your system. Note that these tests are not yet hooked
168-
up to the environment created with `docker-compose` above.
168+
up to the environment created with `docker compose` above.
169169

170170
With docker installed and configured appropriately, run
171171

@@ -218,7 +218,7 @@ used for all installations, including for local development. The database URL,
218218

219219
To migrate the database,
220220

221-
* Install the alembic package (if you haven't yet): `pip install -r requirements.txt` (or `uv pip install -r requirements.txt` if using uv)
221+
* Install the dependencies (if you haven't yet): `uv pip install -e ".[dev]"`
222222
* Run `alembic upgrade head`
223223

224224
## Deployment
@@ -229,7 +229,7 @@ To set this up, run `heroku git:remote -a pulseguardian`.
229229
Then just push the latest `main` branch to the `heroku` remote: `git push heroku main`
230230

231231
[the wiki]: https://wiki.mozilla.org/Auto-tools/Projects/Pulse/PulseGuardian
232-
[docker-compose]: https://docs.docker.com/compose/
232+
[docker compose]: https://docs.docker.com/compose/
233233
[HACKING.md]: https://hg.mozilla.org/automation/mozillapulse/file/tip/HACKING.md
234234
[Travis CI]: https://travis-ci.org/mozilla/pulseguardian
235235
[gunicorn]: https://www.digitalocean.com/community/articles/how-to-deploy-python-wsgi-apps-using-gunicorn-http-server-behind-nginx

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
db:
3-
image: postgres:11-alpine
3+
image: postgres:16-alpine
44
volumes:
55
- pgdata:/var/lib/postgresql/data
66
ports:

docker/Dockerfile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
FROM python:3.13-slim
2+
23
RUN apt-get update && apt-get install -y \
34
gcc \
45
libffi-dev \
56
libssl-dev \
67
postgresql-client \
78
python3-dev \
89
&& rm -rf /var/lib/apt/lists/*
9-
ENV PYTHONUNBUFFERED 1
10-
ENV DATABASE_URL postgres://postgres:postgres@db:5432/postgres
11-
ENV FLASK_SECRET_KEY GBhQrZfbN9KGMcyLVImGeS2Wtj3SFCdF
12-
ENV RABBIT_MANAGEMENT_URL http://pulse:15672/api/
13-
ENV EMAIL_ENABLED 0
10+
11+
ENV PYTHONUNBUFFERED=1 \
12+
DATABASE_URL=postgres://postgres:postgres@db:5432/postgres \
13+
FLASK_SECRET_KEY=GBhQrZfbN9KGMcyLVImGeS2Wtj3SFCdF \
14+
RABBIT_MANAGEMENT_URL=http://pulse:15672/api/ \
15+
EMAIL_ENABLED=0
16+
1417
WORKDIR /code
1518

1619
# Upgrade pip to latest version
1720
RUN pip install --no-cache-dir --upgrade pip
1821

19-
# Copy and install dependencies
20-
ADD requirements.txt /code/
21-
RUN pip install --no-cache-dir -r requirements.txt
22-
2322
# Copy application code
2423
COPY . /code/
2524

requirements.txt

Lines changed: 0 additions & 102 deletions
This file was deleted.

runtime.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)