diff --git a/.build-files/docker-compose-local.template.yml b/.build-files/docker-compose-local.template.yml index 72716b58..f651e5f5 100644 --- a/.build-files/docker-compose-local.template.yml +++ b/.build-files/docker-compose-local.template.yml @@ -22,91 +22,6 @@ services: - path: ${DOCKER_ENV_FILE} # relative to docker compose (has to be in same directory) required: true - # Depends on database. Database must be healthy before starting server - server: - build: - context: ../ # relative to docker compose - dockerfile: ./.build-files/Dockerfile.server # relatvie to build context - args: - DOCKER_ENV_FILE: ${DOCKER_ENV_FILE} - ports: - - "8000:8000" - environment: - DJANGO_ENV_FILE: "/app/.env" - depends_on: - db: - condition: service_healthy - redis: - condition: service_healthy - - celery: - build: - context: ../ # relative to docker compose - dockerfile: ./.build-files/Dockerfile.celery # relatvie to build context - args: - DOCKER_ENV_FILE: ${DOCKER_ENV_FILE} - command: - [ - "celery", - "--app", - "celery_app", - "worker", - "--loglevel", - "info", - "--without-heartbeat", - "-c", - "4", - ] - # Docker Compose does not set the TTY width, which causes Celery errors - tty: false - environment: - DJANGO_ENV_FILE: "/app/.env" - depends_on: - db: - condition: service_healthy - redis: - condition: service_healthy - - # MySQL service. Has healthcheck which uses mysqladmin to ping before reporting healthy. - db: - image: mysql:latest - environment: - MYSQL_DATABASE: ${DATABASE_NAME} - MYSQL_USER: ${DATABASE_USER} - MYSQL_PASSWORD: ${DATABASE_PASSWORD} - MYSQL_ROOT_PASSWORD: ${DATABASE_ROOT_PASSWORD} - volumes: - - mysql-data:/var/lib/mysql - ports: - - "3306:3306" - healthcheck: - test: - [ - "CMD", - "mysqladmin", - "ping", - "-h", - "localhost", - "-u", - "root", - "-p${DATABASE_ROOT_PASSWORD}", - ] - timeout: 20s - retries: 10 - env_file: - - path: ${DOCKER_ENV_FILE} # relative to docker compose (has to be in same directory) - required: true - - redis: - image: redis:latest - ports: - - "6379:6379" - healthcheck: - test: ["CMD", "redis-cli", "ping"] - interval: 10s - timeout: 5s - retries: 5 - data: build: context: ./ @@ -125,6 +40,5 @@ services: - duckdb-data:/app/duckdb-data volumes: - mysql-data: duckdb-data: - migrations_volume: + migrations_volume: \ No newline at end of file diff --git a/.build-files/nginx-http-local.conf b/.build-files/nginx-http-local.conf index 31b82112..36c6a5cb 100644 --- a/.build-files/nginx-http-local.conf +++ b/.build-files/nginx-http-local.conf @@ -21,13 +21,6 @@ http { try_files $uri $uri/ /index.html; } - location /api { - proxy_pass http://server:8000/api; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } location /data { proxy_pass http://data:9000/; diff --git a/build.py b/build.py index ed9e1a40..dc5b9ac0 100644 --- a/build.py +++ b/build.py @@ -300,8 +300,12 @@ def build_containers(env_file, disable_spinner=False): else: print("Building containers...") - process = run_command(f"docker-compose -f .build-files/docker-compose.yml" - f" --env-file {env_file} build") + service_string = "" + if services is not None: + service_string = " ".join(services) + + command = f"docker-compose -f .build-files/docker-compose.yml --env-file {env_file} build {service_string}" + process = run_command(command) process.wait() # Wait for the build to complete if not disable_spinner: @@ -331,8 +335,13 @@ def start_containers(env_file, disable_spinner=False): spinner_thread.start() else: print("Starting containers...") - process = run_command(f"docker-compose -f .build-files/docker-compose.yml" - f" --env-file {env_file} up -d") + + service_string = "" + if services is not None: + service_string = " ".join(services) + + command = f"docker-compose -f .build-files/docker-compose.yml --env-file {env_file} up -d {service_string}" + process = run_command(command) process.wait() # Wait for the containers to start