Skip to content

Commit

Permalink
Update docker-compose.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinguy authored Sep 13, 2024
1 parent 2a105c9 commit ac0774d
Showing 1 changed file with 37 additions and 21 deletions.
58 changes: 37 additions & 21 deletions dockerhub/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
version: '3.8'

services:
server:
image: sunsolution/betterscan-server:latest
restart: always
environment:
OPENAI_GPT_API:
OPENAI_GPT_API: ${OPENAI_GPT_API}
depends_on:
- postgres
postgres:
condition: service_healthy
working_dir: /srv/betterscan/
entrypoint: sh
command: -c "mkdir -p data1/repositories data2/tasks setup_state && if [ -f /srv/betterscan/setup_state/setup_done ]; then python /srv/betterscan/manage.py runserver; else python /srv/betterscan/manage.py setup && touch /srv/betterscan/setup_state/setup_done; fi"
command: -c "mkdir -p data1/repositories data2/tasks setup_state && \
if [ -f /srv/betterscan/setup_state/setup_done ]; \
then python /srv/betterscan/manage.py runserver; \
else python /srv/betterscan/manage.py setup && touch /srv/betterscan/setup_state/setup_done; \
fi"
ports:
- 5001:5000
volumes:
- ./data1:/srv/betterscan/quantifiedcode/data/
- ./data2:/srv/betterscan/quantifiedcode/backend/data/tasks
- ./setup_state:/srv/betterscan/setup_state
links:
- "postgres"
- data1:/srv/betterscan/quantifiedcode/data/
- data2:/srv/betterscan/quantifiedcode/backend/data/tasks
- setup_state:/srv/betterscan/setup_state

postgres:
image: postgres:13.2
Expand All @@ -30,44 +35,55 @@ services:
- "5432:5432"
volumes:
- db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U qc"]
interval: 10s
timeout: 5s
retries: 5

worker_1:
image: sunsolution/betterscan-worker:latest
ulimits:
stack: -1
restart: always
environment:
OPENAI_GPT_API:
OPENAI_GPT_API: ${OPENAI_GPT_API}
hostname: worker_1
depends_on:
- rabbitmq3
- postgres
- server
rabbitmq3:
condition: service_healthy
postgres:
condition: service_healthy
server:
condition: service_healthy
working_dir: /srv/betterscan/
entrypoint: sh
command: -c "python /srv/betterscan/manage.py runworker"
volumes:
- ./data1:/srv/betterscan/quantifiedcode/data/
- ./data2:/srv/betterscan/quantifiedcode/backend/data/tasks
links:
- "rabbitmq3"
- "server"
- "postgres"
- data1:/srv/betterscan/quantifiedcode/data/
- data2:/srv/betterscan/quantifiedcode/backend/data/tasks

rabbitmq3:
container_name: "rabbitmq"
image: rabbitmq:3.8-management-alpine
environment:
- RABBITMQ_DEFAULT_USER=qc
- RABBITMQ_DEFAULT_PASS=qc
RABBITMQ_DEFAULT_USER: qc
RABBITMQ_DEFAULT_PASS: qc
ports:
- 5672:5672
- 15672:15672
healthcheck:
test: [ "CMD", "nc", "-z", "localhost", "5672" ]
test: ["CMD", "nc", "-z", "localhost", "5672"]
interval: 5s
timeout: 15s
retries: 1

volumes:
db-data:
driver: local
data1:
driver: local
data2:
driver: local
setup_state:
driver: local

0 comments on commit ac0774d

Please sign in to comment.