Begin modernising Docker files

This commit is contained in:
Mark Veidemanis 2022-11-22 21:53:21 +00:00
parent 39ae1203be
commit 7008c365a6
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
3 changed files with 47 additions and 15 deletions

View File

@ -3,6 +3,7 @@ version: "2"
services:
app:
image: pathogen/neptune:latest
container_name: neptune
build: ./docker
volumes:
- ${PORTAINER_GIT_DIR}:/code
@ -19,9 +20,14 @@ services:
condition: service_healthy
migration:
condition: service_started
networks:
- default
- pathogen
- elastic
migration:
image: pathogen/neptune:latest
container_name: migration_neptune
command: sh -c '. /venv/bin/activate && python manage.py migrate --noinput'
volumes:
- ${PORTAINER_GIT_DIR}:/code
@ -44,24 +50,34 @@ services:
tmp:
image: busybox
command: chmod -R 777 /var/run/redis
container_name: tmp_neptune
command: chmod -R 777 /var/run/socks
volumes:
- /var/run/redis
- /var/run/socks
redis:
image: redis
container_name: redis_neptune
command: redis-server /etc/redis.conf
ulimits:
nproc: 65535
nofile:
soft: 65535
hard: 65535
volumes:
- ${PORTAINER_GIT_DIR}/docker/redis.conf:/etc/redis.conf
volumes_from:
- tmp
healthcheck:
test: "redis-cli -s /var/run/redis/redis.sock ping"
test: "redis-cli -s /var/run/socks/redis.sock ping"
interval: 2s
timeout: 2s
retries: 15
networks:
default:
external:
name: pathogen
driver: bridge
pathogen:
external: true
elastic:
external: true

View File

@ -1,8 +1,9 @@
version: "2"
version: "2.2"
services:
app:
image: pathogen/neptune:latest
container_name: neptune
build: ./docker/prod
volumes:
- ${PORTAINER_GIT_DIR}:/code
@ -20,9 +21,14 @@ services:
condition: service_healthy
migration:
condition: service_started
networks:
- default
- pathogen
- elastic
migration:
image: pathogen/neptune:latest
container_name: migration_neptune
build: ./docker/prod
command: sh -c '. /venv/bin/activate && python manage.py migrate --noinput'
volumes:
@ -37,24 +43,34 @@ services:
tmp:
image: busybox
command: chmod -R 777 /var/run/redis
container_name: tmp_neptune
command: chmod -R 777 /var/run/socks
volumes:
- /var/run/redis
- /var/run/socks
redis:
image: redis
container_name: redis_neptune
command: redis-server /etc/redis.conf
ulimits:
nproc: 65535
nofile:
soft: 65535
hard: 65535
volumes:
- ${PORTAINER_GIT_DIR}/docker/redis.conf:/etc/redis.conf
volumes_from:
- tmp
healthcheck:
test: "redis-cli -s /var/run/redis/redis.sock ping"
test: "redis-cli -s /var/run/socks/redis.sock ping"
interval: 2s
timeout: 2s
retries: 15
networks:
default:
external:
name: pathogen
driver: bridge
pathogen:
external: true
elastic:
external: true

View File

@ -1,2 +1,2 @@
unixsocket /var/run/redis/redis.sock
unixsocket /var/run/socks/redis.sock
unixsocketperm 777