Skip to content

Commit

Permalink
Add docker-compose file for dev
Browse files Browse the repository at this point in the history
  • Loading branch information
TheReverend403 committed Mar 8, 2025
1 parent c7315c9 commit 653647b
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Log in to the container registry
if: github.event_name != 'pull_request'
if: ${{ github.event_name != 'pull_request' && !env.ACT }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
Expand All @@ -54,7 +54,7 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.event_name != 'pull_request' && !env.ACT }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
Expand Down
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/config
/data

docker-compose.*
docker/data
docker/config

.vscode/
.idea/
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A set of <a href="https://github.com/gawel/irc3">irc3</a> plugins providing vari

Requirements:

* PostgreSQL
- PostgreSQL

## Setting up the development environment

Expand All @@ -32,6 +32,15 @@ uv run pre-commit install

## Running

### Docker

```sh
cp docker/.env.example docker/.env # Open and set any empty variables
docker compose -f docker/docker-compose.dev.yml up --build --pull always
```

### Manual

```sh
cp config.ini.dist config.ini
$EDITOR config.ini
Expand Down
4 changes: 4 additions & 0 deletions docker/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CFG_BOT_NICK=
CFG_BOT_USERNAME=
CFG_BOT_REALNAME=
CFG_IRC_HOST=
57 changes: 57 additions & 0 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
services:
cappuccino:
container_name: cappuccino
restart: "no"
init: true
read_only: true
user: ${PUID:-1000}:${PGID:-1000}
depends_on:
db:
condition: service_healthy
env_file: .env
environment:
CFG_BOT_NICK: ${CFG_BOT_NICK:?}
CFG_BOT_REALNAME: ${CFG_BOT_REALNAME:?}
CFG_BOT_USERNAME: ${CFG_BOT_USERNAME:?}
CFG_DB_URI: ${CFG_DB_URI:-postgresql://${DB_USER:-cappuccino}:${DB_PASSWORD:-cappuccino}@${DB_HOST:-db}/${DB_NAME:-cappuccino}}
CFG_IRC_HOST: ${CFG_IRC_HOST:?}
CFG_IRC_PORT: ${CFG_IRC_PORT:-6697}
CFG_IRC_SSL: ${CFG_IRC_SSL:-true}
volumes:
- /etc/localtime:/etc/localtime:ro
- ${BASE_DIR:-.}/config/app:/config
- ../:/app:ro
tmpfs:
- /tmp
networks:
- cappuccino
build:
context: ../

db:
image: postgres:17-alpine
container_name: cappuccino_db
restart: "no"
user: ${PUID:-1000}:${PGID:-1000}
env_file: .env
environment:
POSTGRES_DB: ${DB_NAME:-cappuccino}
POSTGRES_PASSWORD: ${DB_PASSWORD:-cappuccino}
POSTGRES_USER: ${DB_USER:-cappuccino}
volumes:
- ${BASE_DIR:-.}/data/postgresql:/var/lib/postgresql/data
networks:
- cappuccino
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -q --username=$$POSTGRES_USER --host=$$POSTGRES_HOST",
]
start_period: 5s
start_interval: 1s
interval: 10s
timeout: 1s

networks:
cappuccino:
66 changes: 33 additions & 33 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 653647b

Please sign in to comment.