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

View File

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