Skip to content

Commit

Permalink
consolidate ENV concerns outside of docker-compose
Browse files Browse the repository at this point in the history
amend README and comments
  • Loading branch information
ballPointPenguin committed May 21, 2020
1 parent aa2b96d commit 0c9ddd0
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 44 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,17 @@ Recommendations: Docker-Machine (on [DigitalOcean with 2GB memory][do-tut])

[do-tut]: https://www.digitalocean.com/community/tutorials/how-to-provision-and-manage-remote-docker-hosts-with-docker-machine-on-ubuntu-16-04


```
GIT_HASH=$(git log --pretty="%h" -n 1) docker-compose up --build --detach
# first build or re-build:
docker-compose build --build-arg GIT_HASH $(git rev-parse --short HEAD) --parallel
# otherwise:
docker-compose up --detach
# to stop:
docker-compose down
# (or Ctrl+C if you did not run with --detach)
# check your ip (only necessary on docker-machine):
docker-machine ip
>>> 123.45.67.89
```
Expand Down
71 changes: 28 additions & 43 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,114 +1,99 @@
# first build or re-build:
# docker-compose up --build
# docker-compose build --build-arg GIT_HASH $(git rev-parse --short HEAD) --parallel
# full re-build with no cache from previous buils:
# docker-compose build --build-arg GIT_HASH $(git rev-parse --short HEAD) --parallel --no-cache
# otherwise:
# docker-compose up
# docker-compose up --detach
# to stop:
# docker-compose down

version: "3.1"

services:

server:
container_name: polis-server
build:
context: ./server
dockerfile: Dockerfile
environment:
STATIC_FILES_HOST: file-server
STATIC_FILES_PORT: 8080
STATIC_FILES_ADMINDASH_PORT: 8080
SHOULD_USE_TRANSLATION_API: 'false'
DATABASE_URL: postgres://postgres:oiPorg3Nrz0yqDLE@postgres:5432/polis-dev
WEBSERVER_USERNAME: ws-user
WEBSERVER_PASS: ws-pass
MATH_ENV: dev
env_file: ./server/docker-dev.env
depends_on:
- 'postgres'
- 'file-server'
- "postgres"
- "file-server"
networks:
- 'polis-dev'
- "polis-dev"
ports:
- "5000:5000"


math:
container_name: polis-math
depends_on:
- 'postgres'
- "postgres"
build:
context: ./math
environment:
DATABASE_URL: postgres://postgres:oiPorg3Nrz0yqDLE@postgres:5432/polis-dev
WEBSERVER_USERNAME: ws-user
WEBSERVER_PASS: ws-pass
env_file: ./math/docker-dev.env
networks:
- 'polis-dev'

- "polis-dev"

postgres:
container_name: polis-postgres
restart: always
env_file: ./server/docker-db-dev.env
build:
context: ./server
dockerfile: Dockerfile-db
networks:
- 'polis-dev'
- "polis-dev"
volumes:
- 'backups:/backups'
- 'postgres:/var/lib/postgresql/data'
- "backups:/backups"
- "postgres:/var/lib/postgresql/data"

nginx-proxy:
container_name: polis-nginx-proxy
build:
context: ./file-server
dockerfile: nginx.Dockerfile
depends_on:
- 'server'
- "server"
networks:
- 'polis-dev'
- "polis-dev"
ports:
- '80:80'
- "80:80"

file-server:
container_name: polis-file-server
build:
context: ./file-server
dockerfile: Dockerfile
depends_on:
- 'client-participation'
- 'client-admin'
- 'client-report'
- "client-participation"
- "client-admin"
- "client-report"
networks:
- 'polis-dev'
- "polis-dev"
ports:
- '8080:8080'
- "8080:8080"

client-participation:
container_name: polis-client-participation
image: polis/client-participation
build:
context: ./client-participation
args:
GIT_HASH: null

client-admin:
container_name: polis-client-admin
image: polis/client-admin
build:
context: ./client-admin
args:
GIT_HASH: null

client-report:
container_name: polis-client-report
image: polis/client-report
build:
context: ./client-report
args:
GIT_HASH: null



networks:
polis-dev:

volumes:
backups:
postgres:

0 comments on commit 0c9ddd0

Please sign in to comment.