Skip to content

Commit

Permalink
Merge pull request #92 from bcgov/dev
Browse files Browse the repository at this point in the history
Release changes for business profile, create namespace
  • Loading branch information
ikethecoder authored Jun 30, 2021
2 parents cd8315f + 006045b commit c173a6b
Show file tree
Hide file tree
Showing 40 changed files with 4,003 additions and 562 deletions.
10 changes: 8 additions & 2 deletions .env.local
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
AUTH_STRATEGY=Oauth2Proxy
ADAPTER=mongoose
KNEX_HOST=kong-db
KNEX_PORT=5432
KNEX_USER=keystonejsuser
KNEX_PASSWORD=keystonejsuser
KNEX_DATABASE=keystonejs
ADAPTER=knex #mongoose
MONGO_URL=mongodb://mongodb:27017/keystonedb4
MONGO_USER=
MONGO_PASSWORD=
KONG_URL=<UPDATE_ME>
KONG_URL=http://kong.localtest.me:8001
JWKS_URL=http://keycloak.localtest.me:9080/auth/realms/master/protocol/openid-connect/certs
FEEDER_URL=http://localhost:6000
NEXT_PUBLIC_API_ROOT=http://oauth2proxy.localtest.me:4180
Expand All @@ -16,3 +21,4 @@ KEYCLOAK_REALM=master
EMAIL_ENABLED=false
EXTERNAL_URL=http://oauth2proxy.localtest.me:4180
OIDC_ISSUER=http://keycloak.localtest.me:9080/auth/realms/master
LOCAL_ENV=true
3 changes: 2 additions & 1 deletion .github/workflows/ci-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ jobs:
value: '${{ secrets.KEYCLOAK_AUTH }}'
KEYCLOAK_REALM:
value: '${{ secrets.KEYCLOAK_REALM }}'
COOKIE_SECURE:
value: 'true'
readinessProbe:
exec:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,5 @@ _tmp

kc.js

# vs code settings
.vscode
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ Once running, the `api services portal` application is reachable via `localhost:

1. Create a `.env` from `.env.local` file
2. Edit `.env` file by updating all (`<UPDATE_ME>`)'s with appropriate values
3. Update `cookie_secret` in `oauth2-proxy/oauth2-proxy-local.cfg` (must by 16 or 24 characters in length)
4. Run `docker-compose up` to spin up a local development environment with services (MongoDB, Keycloak, OAuth2-proxy, APS-Portal)
5. Go to: http://oauth2proxy.localtest.me:4180
3. Run `docker-compose up` to spin up a local development environment with services (Postgres, Keycloak, OAuth2-proxy, APS-Portal and Kong Gateway)
4. Go to: http://oauth2proxy.localtest.me:4180
5. To login, use username `local` and password `local`
6. `docker-compose down` : Removes all the hosted services

##### Note:
Expand Down
101 changes: 83 additions & 18 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
version: '3.8'

x-common-variables: &common-variables
KONG_DATABASE: postgres
KONG_PG_DATABASE: kong
KONG_PG_HOST: kong-db
KONG_PG_USER: konguser
KONG_PG_PASSWORD: konguser

services:
keycloak:
image: jboss/keycloak:11.0.3
container_name: keycloak
hostname: keycloak
depends_on:
- kong-db
command:
[
'-b',
Expand All @@ -16,49 +26,42 @@ services:
]
ports:
- 9080:9080/tcp
#environment:
#KEYCLOAK_USER: local
#KEYCLOAK_PASSWORD: local
environment:
#KEYCLOAK_USER: local
#KEYCLOAK_PASSWORD: local
DB_ADDR: kong-db:5432
DB_USER: keycloakuser
DB_PASSWORD: keycloakuser
volumes:
- ./keycloak/master-realm.json:/tmp/realm-config/master-realm.json
- ./local/keycloak/master-realm.json:/tmp/realm-config/master-realm.json
networks:
keycloak:
aliases:
- keycloak.localtest.me
mongodb:
image: mongo:latest
container_name: mongodb
restart: unless-stopped
ports:
- 27017:27017
networks:
portal: {}
oauth2-proxy:
image: quay.io/oauth2-proxy/oauth2-proxy:v7.1.3
container_name: oauth2-proxy
command: --config ./oauth2-proxy.cfg
depends_on:
- keycloak
ports:
- 4180:4180/tcp
volumes:
- ./oauth2-proxy/oauth2-proxy-local.cfg:/oauth2-proxy.cfg
- ./local/oauth2-proxy/oauth2-proxy-local.cfg:/oauth2-proxy.cfg
restart: unless-stopped
env_file:
- .env
networks:
keycloak: {}
portal: {}
kong-net: {}
oauth2-proxy:
aliases:
- oauth2proxy.localtest.me

apsportal:
container_name: apsportal
depends_on:
- mongodb
- keycloak
- oauth2-proxy
command:
- dev
build:
context: .
dockerfile: Dockerfile
Expand All @@ -70,7 +73,69 @@ services:
- apsportal.localtest.me
keycloak: {}
oauth2-proxy: {}
kong-db:
image: postgres:latest
container_name: kong-db
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
restart: on-failure
tty: true
ports:
- 5432:5432
volumes:
- ./local/db/database-init.sql:/docker-entrypoint-initdb.d/1-init.sql
- ./local/db/keystone-init.sql:/docker-entrypoint-initdb.d/2-init.sql
- aps-pg-data:/var/lib/postgresql/data
networks:
- kong-net
- keycloak
- portal
kong-migrations:
image: kong:latest
command: kong migrations bootstrap
depends_on:
- kong-db
environment: *common-variables
networks:
- kong-net
restart: on-failure
kong-migrations-up:
image: kong:latest
command: kong migrations up && kong migrations finish
depends_on:
- kong-db
environment: *common-variables
networks:
- kong-net
restart: on-failure
kong:
image: kong:latest
container_name: kong
depends_on:
- kong-migrations
- kong-migrations-up
environment:
<<: *common-variables
KONG_ADMIN_ACCESS_LOG: /dev/stdout
KONG_ADMIN_ERROR_LOG: /dev/stderr
KONG_CASSANDRA_CONTACT_POINTS: kong-db
KONG_NGINX_WORKER_PROCESSES: '1'
KONG_PROXY_ACCESS_LOG: /dev/stdout
KONG_PROXY_ERROR_LOG: /dev/stderr
KONG_ADMIN_LISTEN: 0.0.0.0:8001
ports:
- 8000:8000
- 8001:8001
networks:
kong-net:
aliases:
- kong.localtest.me
restart: on-failure:5
networks:
keycloak: {}
oauth2-proxy: {}
portal: {}
kong-net: {}
volumes:
aps-pg-data: {}
Loading

0 comments on commit c173a6b

Please sign in to comment.