diff --git a/Dockerfile b/Dockerfile index 3198abd..deb96f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/README.md b/README.md index 8513d83..2bd729f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index da76ddd..9dd461d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,37 +1,40 @@ -version: '3' +version: "3" services: web: build: . + restart: unless-stopped environment: # you should change secret key - - 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: