Skip to content

Commit

Permalink
refactor: docs and docker volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
not7cd committed Jul 10, 2024
1 parent b0850d2 commit 3b7af9b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ WORKDIR /app
RUN poetry install --no-dev
COPY . .

#default config
ENV SECRET_KEY S3cret

RUN mkdir /data && chown nobody /data
VOLUME ["/data"]

Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,26 @@ source env.sh
- Create database

```shell
# if running web app locally
poetry run python helpers/db_create.py
# or
poetry run init-db
# if running web app in docker
docker compose run web python helpers/db_create.py
```

## Running

```shell
poetry run python -m whois
# or
docker compose up
```

## OAuth2 integration

see: https://github.com/navikt/mock-oauth2-server

configuration can be found in ./tests/resources

## Deployment

```shell
Expand Down
19 changes: 11 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
version: '3'
version: "3"
services:
web:
build: .
restart: unless-stopped
environment:
# you should change secret key
- SECRET_KEY=<your_secret_key>
- SECRET_KEY=example123
- APP_DB_DIALECT=postgresql
- APP_DB_NAME=whohacks
- APP_DB_USER=whohacks
- APP_DB_PASSWORD=S3cret
- APP_DB_HOST=postgres
- APP_DB_PORT=5432
#- APP_OAUTH_OPENID="http://sso.hsp.sh/auth/realms/hsp/.well-known/openid-configuration"
- APP_OAUTH_OPENID=http://oauth2:8080/issuer1/.well-known/openid-configuration

ports:
# use 127.0.0.1:8000:8000
- "8000:8000"
volumes:
- database:/data
- sqlite:/data
- /etc/localtime:/etc/localtime:ro
restart: always
depends_on:
- postgres

postgres:
image: postgres:latest
restart: unless-stopped
ports:
- 5432:5432
volumes:
- ~/apps/postgres:/var/lib/postgresql/data
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=S3cret
- POSTGRES_USER=whohacks
- POSTGRES_DB=whohacks

volumes:
database:

sqlite:
postgres_data:

0 comments on commit 3b7af9b

Please sign in to comment.