Skip to content

Commit

Permalink
Add memcached as own service
Browse files Browse the repository at this point in the history
  • Loading branch information
EHJ-52n committed Sep 13, 2023
1 parent 31d756c commit 8171c96
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
10 changes: 7 additions & 3 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,13 @@ CACHE_BUSTING_STATIC_ENABLED=False

MEMCACHED_ENABLED=False
MEMCACHED_BACKEND=django.core.cache.backends.memcached.MemcachedCache
MEMCACHED_LOCATION=127.0.0.1:11211
MEMCACHED_LOCATION=memcached:11211
MEMCACHED_LOCK_EXPIRE=3600
MEMCACHED_LOCK_TIMEOUT=10
#
# Options for memcached binary, e.g. -vvv to log all requests and cache hits
#
MEMCACHED_OPTIONS=

MAX_DOCUMENT_SIZE=200
CLIENT_RESULTS_LIMIT=5
Expand Down Expand Up @@ -226,9 +230,9 @@ LDAP_GROUP_PROFILE_MEMBER_ATTR=uniqueMember

# expressed in KB
# CELERY__MAX_MEMORY_PER_CHILD="200000"
# ##
# ##
# Note right autoscale value must coincide with worker concurrency value
# CELERY__AUTOSCALE_VALUES="15,10"
# CELERY__AUTOSCALE_VALUES="15,10"
# CELERY__WORKER_CONCURRENCY="10"
# ##
# CELERY__OPTS="--without-gossip --without-mingle -Ofair -B -E"
Expand Down
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@ services:
- statics:/mnt/volumes/statics
restart: unless-stopped

# memcached service
memcached:
image: memcached:alpine
container_name: memcached4${COMPOSE_PROJECT_NAME}
command: memcached ${MEMCACHED_OPTIONS}
restart: on-failure
healthcheck:
test: nc -z 127.0.0.1 11211
interval: 30s
timeout: 30s
retries: 5
start_period: 30s

# Gets and installs letsencrypt certificates
letsencrypt:
image: geonode/letsencrypt:latest
Expand Down
5 changes: 2 additions & 3 deletions src/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ invoke () {
echo "$@ tasks done"
}

# Start cron && memcached services
# Start cron service
service cron restart
service memcached restart

echo $"\n\n\n"
echo "-----------------------------------------------------"
Expand Down Expand Up @@ -70,6 +69,6 @@ echo "-----------------------------------------------------"
echo "FINISHED DJANGO ENTRYPOINT --------------------------"
echo "-----------------------------------------------------"

# Run the CMD
# Run the CMD
echo "got command $cmd"
exec $cmd

0 comments on commit 8171c96

Please sign in to comment.