From 939a67444feb01b32ecbe87cfef61a42d53cc973 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Wed, 12 Oct 2022 07:22:22 +0100 Subject: [PATCH] Fix Docker and comment out Redis --- core/__init__.py | 5 ++- docker-compose.yml | 72 +++++++++++++++++----------------- docker/docker-compose.prod.yml | 65 +++++++++++++++++------------- 3 files changed, 76 insertions(+), 66 deletions(-) diff --git a/core/__init__.py b/core/__init__.py index 73d371f..ed37f69 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -1,8 +1,9 @@ import stripe from django.conf import settings -from redis import StrictRedis -r = StrictRedis(unix_socket_path="/var/run/redis/redis.sock", db=0) +# from redis import StrictRedis + +# r = StrictRedis(unix_socket_path="/var/run/redis/redis.sock", db=0) if settings.STRIPE_TEST: stripe.api_key = settings.STRIPE_API_KEY_TEST diff --git a/docker-compose.yml b/docker-compose.yml index 345b0ee..aceb8ab 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,11 +12,11 @@ services: - "${APP_PORT}:8000" env_file: - .env - volumes_from: - - tmp + # volumes_from: + # - tmp depends_on: - redis: - condition: service_healthy + # redis: + # condition: service_healthy migration: condition: service_started @@ -27,41 +27,41 @@ services: - ${PORTAINER_GIT_DIR}:/code - ${APP_LOCAL_SETTINGS}:/code/app/local_settings.py - ${APP_DATABASE_FILE}:/code/db.sqlite3 - volumes_from: - - tmp - depends_on: - redis: - condition: service_healthy + # volumes_from: + # - tmp + # depends_on: + # redis: + # condition: service_healthy - # pyroscope: - # image: pyroscope/pyroscope - # environment: - # - PYROSCOPE_LOG_LEVEL=debug - # ports: - # - '4040:4040' - # command: - # - 'server' + # tmp: + # image: busybox + # command: chmod -R 777 /var/run/redis + # volumes: + # - /var/run/redis - tmp: - image: busybox - command: chmod -R 777 /var/run/redis - volumes: - - /var/run/redis - - redis: - image: redis - command: redis-server /etc/redis.conf - volumes: - - ${PORTAINER_GIT_DIR}/docker/redis.conf:/etc/redis.conf - volumes_from: - - tmp - healthcheck: - test: "redis-cli -s /var/run/redis/redis.sock ping" - interval: 2s - timeout: 2s - retries: 15 + # redis: + # image: redis + # command: redis-server /etc/redis.conf + # ulimits: + # nproc: 65535 + # nofile: + # soft: 65535 + # hard: 65535 + # volumes: + # - ${PORTAINER_GIT_DIR}/docker/redis.conf:/etc/redis.conf + # - redis_data:/data + # volumes_from: + # - tmp + # healthcheck: + # test: "redis-cli -s /var/run/redis/redis.sock ping" + # interval: 2s + # timeout: 2s + # retries: 15 networks: default: external: - name: xf \ No newline at end of file + name: xf + +# volumes: +# redis_data: {} \ No newline at end of file diff --git a/docker/docker-compose.prod.yml b/docker/docker-compose.prod.yml index 271305f..5ab4956 100644 --- a/docker/docker-compose.prod.yml +++ b/docker/docker-compose.prod.yml @@ -1,4 +1,4 @@ -version: "2" +version: "2.2" services: app: @@ -13,11 +13,11 @@ services: - "${APP_PORT}:8000" # uwsgi socket env_file: - ../stack.env - volumes_from: - - tmp + # volumes_from: + # - tmp depends_on: - redis: - condition: service_healthy + # redis: + # condition: service_healthy migration: condition: service_started @@ -29,32 +29,41 @@ services: - ${PORTAINER_GIT_DIR}:/code - ${APP_LOCAL_SETTINGS}:/code/app/local_settings.py - ${APP_DATABASE_FILE}:/code/db.sqlite3 - volumes_from: - - tmp - depends_on: - redis: - condition: service_healthy + # volumes_from: + # - tmp + # depends_on: + # redis: + # condition: service_healthy - tmp: - image: busybox - command: chmod -R 777 /var/run/redis - volumes: - - /var/run/redis + # tmp: + # image: busybox + # command: chmod -R 777 /var/run/redis + # volumes: + # - /var/run/redis - redis: - image: redis - command: redis-server /etc/redis.conf - volumes: - - ${PORTAINER_GIT_DIR}/docker/redis.conf:/etc/redis.conf - volumes_from: - - tmp - healthcheck: - test: "redis-cli -s /var/run/redis/redis.sock ping" - interval: 2s - timeout: 2s - retries: 15 + # redis: + # image: redis + # command: redis-server /etc/redis.conf + # ulimits: + # nproc: 65535 + # nofile: + # soft: 65535 + # hard: 65535 + # volumes: + # - ${PORTAINER_GIT_DIR}/docker/redis.conf:/etc/redis.conf + # - redis_data:/data + # volumes_from: + # - tmp + # healthcheck: + # test: "redis-cli -s /var/run/redis/redis.sock ping" + # interval: 2s + # timeout: 2s + # retries: 15 networks: default: external: - name: xf \ No newline at end of file + name: xf + +# volumes: +# redis_data: {}