diff --git a/README.md b/README.md index 4c91d0a..529fb1d 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,10 @@ Run everything (frontend, backend, db, swagger, quests): docker compose build docker compose up -d +If you want to enable social login, you should have OAuth client token in a `.env` file: + + docker compose --env-file .env up -d + ## Testing Run Cypress locally, using the current development containers: @@ -42,6 +46,17 @@ Run Cypress in container, create brand-new containers along with it: docker compose -f docker-compose.prod.yml pull docker compose -f docker-compose.prod.yml up -d +To enable social login, you should have OAuth client token in a `.env` file: +You can copy from `example.env` + + # .env + GOOGLE_CLIENT_ID=... + GOOGLE_CLIENT_SECRET=... + +To enable it: + + docker compose --env-file .env -f docker-compose.prod.yml up -d + ## Standalone App (without Docker) Source: `app/` diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index ebc62c1..5a23b35 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -41,6 +41,8 @@ services: - MONGO_USER=user - MONGO_PASS=user-password - MONGO_DB=odyssey-test + - GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID} + - GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET} base: image: lancatlin/linux-odyssey:base diff --git a/docker-compose.testing.yml b/docker-compose.testing.yml index 658878c..a1ad2ea 100644 --- a/docker-compose.testing.yml +++ b/docker-compose.testing.yml @@ -36,11 +36,11 @@ services: - players volumes: - /var/run/docker.sock:/var/run/docker.sock - env_file: - - .env environment: - MONGO_URL=mongodb://user:user-password@db-test:27017/odyssey-test - DOCKER_NETWORK=linux-odyssey-players + - GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID} + - GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET} db-test: image: mongo diff --git a/docker-compose.yml b/docker-compose.yml index 2c964a0..c0afae7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,12 +26,12 @@ services: - ./server/swagger.yaml:/app/server/swagger.yaml - ./packages:/app/packages - ./quests:/app/quests - env_file: - - .env environment: - MONGO_URL=mongodb://db:27017/odyssey-test - DOCKER_NETWORK=linux-odyssey-players - HOST_PWD=${PWD} + - GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID} + - GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET} db: image: mongo networks: diff --git a/example.env b/example.env new file mode 100644 index 0000000..17418ff --- /dev/null +++ b/example.env @@ -0,0 +1,2 @@ +GOOGLE_CLIENT_ID= +GOOGLE_CLIENT_SECRET= \ No newline at end of file