Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

[WIP] [#267] Use variables in docker-stack-compose.yml #268

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions docker/docker-stack-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ services:
networks:
- overlay
core:
image: quay.io/aelve/codesearch-core:develop
image: quay.io/aelve/codesearch-core:${TAG:?}
deploy:
mode: global
restart_policy:
Expand All @@ -53,7 +53,7 @@ services:
networks:
- overlay
server:
image: quay.io/aelve/codesearch-web-server:develop
image: quay.io/aelve/codesearch-web-server:${TAG:?}
deploy:
mode: global
restart_policy:
Expand All @@ -69,13 +69,11 @@ services:
make serve
environment:
LOG_LEVEL: DEBUG
JAVA_OPTS: "-Dplay.filters.hosts.allowed.1=staging.codesearch.aelve.com -Dplay.filters.hosts.allowed.2=cloud.digitalocean.com"
# In production you must override the APPLICATION_SECRET key
APPLICATION_SECRET: ${SECRET_KEY:-"u?:IPZT:Cun;SP>edigHDs:cpUf2cY\`<7D>b9lHg98^NsVGn]:eLCIjz1Tt_VyIv"}
JAVA_OPTS: "-Dplay.filters.hosts.allowed.1=${SERVER_HOST:?}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removes the cloud.digitalocean.com host. It's unclear whether we can actually remove it without getting in trouble, though.

APPLICATION_SECRET: ${SECRET_KEY:?}
ports:
# In production you must override SERVER_PORT like: `SERVER_PORT=80 docker-compose -f docker-stack-compose.yml ...`
- ${SERVER_PORT:-9000}:80
- ${SERVER_PORT:?}:80
networks:
- overlay
networks:
overlay:
overlay:
4 changes: 4 additions & 0 deletions docker/local.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export TAG=$(git rev-parse --abbrev-ref HEAD)
export SERVER_HOST=localhost
export SERVER_PORT=9000
export SECRET_KEY="u?:IPZT:Cun;SP>edigHDs:cpUf2cY\`<7D>b9lHg98^NsVGn]:eLCIjz1Tt_VyIv"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: how was this key generated? Add a comment.

Copy link
Contributor

@kamilongus kamilongus May 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run command: sbt playGenerateSecret | grep -i 'generated' | cut -d ' ' -f5 in root project directory.

3 changes: 3 additions & 0 deletions docker/prod.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export TAG=latest
export SERVER_HOST=codesearch.aelve.com
export SERVER_PORT=80
3 changes: 3 additions & 0 deletions docker/staging.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export TAG=develop
export SERVER_HOST=staging.codesearch.aelve.com
export SERVER_PORT=80