Skip to content

Commit

Permalink
Merge pull request #107 from smkent/compose-dev
Browse files Browse the repository at this point in the history
Add development configuration for docker-compose
  • Loading branch information
smkent authored Dec 18, 2023
2 parents 63b74db + 7225a0f commit 00e5f0a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
.pytest_results.xml
.venv/
dist/
accounts
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,32 @@ pip install poetry
poetry self add poetry-dynamic-versioning poetry-pre-commit-plugin
```

### Invocation with docker-compose

safeway-coupons can be executed within a Docker container using
`docker-compose.dev.yaml`.

To use, first create an `accounts` file in the same directory with your
safeway-coupons accounts configuration. Then, execute safeway-coupons within a
container using docker-compose:

```console
docker-compose -f docker-compose.dev.yaml up --build
```

The container will run safeway-coupons once, attempt to clip one coupon, and
then stop.

To change the safeway-coupons arguments, modify the `command` value in
`docker-compose.dev.yaml`.

When finished with development tasks, the docker-compose state can be cleaned up
with:

```console
docker-compose -f docker-compose.dev.yaml down
```

### Development tasks

* Setup: `poetry install`
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "3.7"

services:
safeway-coupons:
build: .
command: /usr/local/bin/safeway-coupons -c /accounts -n -d -m 1
environment:
PYTHONUNBUFFERED: 1
restart: "no"
volumes:
- ./accounts:/accounts:ro

0 comments on commit 00e5f0a

Please sign in to comment.