diff --git a/README.md b/README.md index 51eadc6c..496abe27 100644 --- a/README.md +++ b/README.md @@ -125,39 +125,62 @@ The precedence of configurations is as described below. ## Use with Docker -Either use the included docker-compose file, or run two containers from the commandline: -the app itself and a PostgreSQL database for it to store information in. +### Docker-compose + +Configuration file can be provided to the container using a [volume](https://docs.docker.com/compose/compose-file/#volumes) or a [configuration](https://docs.docker.com/compose/compose-file/#configs). ```shell # Set AWS credentials as environment variables: export AWS_ACCESS_KEY_ID= export AWS_SECRET_ACCESS_KEY= + +# Set AWS configuration as environment variables: +export AWS_DEFAULT_REGION= +export AWS_BUCKET= +export AWS_DYNAMODB_TABLE= + +docker-compose up +``` + +Then point your browser to http://localhost:8080. + +### Docker command line + +```shell +# Set AWS credentials as environment variables: +export AWS_ACCESS_KEY_ID= +export AWS_SECRET_ACCESS_KEY= + +# Set AWS configuration as environment variables: +export AWS_DEFAULT_REGION= +export AWS_BUCKET= +export AWS_DYNAMODB_TABLE= + # Spin up the two containers and a network for them to communciate on: -docker network create terranet +docker network create terraboard docker run --name db \ -e POSTGRES_USER=gorm \ -e POSTGRES_DB=gorm \ -e POSTGRES_PASSWORD="" \ - --net terranet \ - --restart=always postgres -d + --net terraboard \ + --detach \ + --restart=always \ + postgres:9.5 + docker run -p 8080:8080 \ - -e AWS_REGION="" \ -e AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}" \ -e AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY}" \ - -e AWS_BUCKET="" \ - -e AWS_DYNAMODB_TABLE="" \ + -e AWS_REGION="${AWS_DEFAULT_REGION}" \ + -e AWS_BUCKET="${AWS_BUCKET}" \ + -e WS_DYNAMODB_TABLE="${AWS_DYNAMODB_TABLE}" \ -e DB_PASSWORD="" \ - -e APP_ROLE_ARN="" \ - --net terranet \ + -e DB_SSLMODE="disable" \ + --net terraboard \ camptocamp/terraboard:latest ``` Then point your browser to http://localhost:8080. -To use the included compose file, you will need to configure an [OAuth application](https://developer.github.com/apps/building-oauth-apps/). - -Configuration file can be provided to the container using a [volume](https://docs.docker.com/compose/compose-file/#volumes) or a [configuration](https://docs.docker.com/compose/compose-file/#configs). - ## Use with Rancher [Camptocamp's Rancher Catalog](https://github.com/camptocamp/camptocamp-rancher-catalog) diff --git a/docker-compose.yml b/docker-compose.yml index a794d0a6..27574291 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,33 +11,15 @@ services: AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} AWS_REGION: ${AWS_DEFAULT_REGION} AWS_BUCKET: ${AWS_BUCKET} - AWS_FILE_EXTENSION: ${AWS_FILE_EXTENSION} - BASE_URL: /terraboard/ - DB_PASSWORD: mypassword AWS_DYNAMODB_TABLE: ${AWS_DYNAMODB_TABLE} - AWS_KEY_PREFIX: ${AWS_KEY_PREFIX} - TERRABOARD_LOG_LEVEL: ${TERRABOARD_LOG_LEVEL} - TERRABOARD_LOGOUT_URL: /oauth2/sign_in + DB_PASSWORD: mypassword + DB_SSLMODE: disable depends_on: - "db" volumes: - ./static:/static:ro - - proxy: - image: camptocamp/oauth2_proxy - command: - - -http-address=0.0.0.0:80 - - -upstream=http://terraboard:8080/terraboard/ - - -provider=github - - -email-domain=* - - -cookie-secure=false - - -redirect-url=http://localhost/oauth2/callback - environment: - OAUTH2_PROXY_CLIENT_ID: ${OAUTH_CLIENT_ID} - OAUTH2_PROXY_CLIENT_SECRET: ${OAUTH_CLIENT_SECRET} - OAUTH2_PROXY_COOKIE_SECRET: ${OAUTH_COOKIE_SECRET} ports: - - 80:80 + - "8080:8080" db: image: postgres:9.5