Skip to content

Commit

Permalink
Added redis alpine based service with logs, updated compose with labe…
Browse files Browse the repository at this point in the history
…ls and depends_on attributes
  • Loading branch information
michalski-luc committed Dec 16, 2020
1 parent 750d26f commit 66124bf
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .docker/alpine/redis/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ARG REDIS_VERSION=${REDIS_VERSION:-"6"}

FROM redis:${REDIS_VERSION}-alpine
MAINTAINER Luc Michalski <[email protected]>

ARG REDIS_LOG_PREFIX_PATH=${REDIS_LOG_PREFIX_PATH:-"/var/log/redis"}

RUN mkdir -p ${REDIS_LOG_PREFIX_PATH} && \
chown redis ${REDIS_LOG_PREFIX_PATH}
6 changes: 6 additions & 0 deletions .env-example
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# General
NAMESPACE="seoz"

# Redis
REDIS_VERSION="6"
REDIS_USER=""
REDIS_PASSWD=""
REDIS_PORT="6379"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ __pycache__

.env
node_modules
shared/logs/redis/*
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Seoz


62 changes: 59 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,72 @@ services:

server:
image: seoz/seoz-server:latest
container_name: ${NAMESPACE}-server
build:
context: ./server
dockerfile: Dockerfile
container_name: ${NAMESPACE}-server

depends_on:
- redis
- mysql
labels:
- "org.label-schema.group=backend"
# - "traefik.enable=true"
networks:
- internal
- web
restart: unless-stopped

dashboard:
image: seoz/seoz-dashboard:latest
container_name: ${NAMESPACE}-dashboard
build:
context: ./admin
dockerfile: Dockerfile
container_name: ${NAMESPACE}-dashboard
depends_on:
- server
networks:
- internal
- web
labels:
- "org.label-schema.group=front"
# - "traefik.enable=true"
restart: unless-stopped

redis:
image: seoz/redis:${REDIS_VERSION}-alpine
build:
context: ./.docker/redis
dockerfile: Dockerfile
args:
REDIS_VERSION: ${REDIS_VERSION}
REDIS_LOG_PREFIX_PATH: ${REDIS_LOG_PREFIX_PATH}
container_name: ${NAMESPACE}-redis
hostname: redis
networks:
- internal
volumes:
- redis-data:/data
- redis-logs:${REDIS_LOG_PREFIX_PATH}
labels:
- "org.label-schema.group=storage"
- "traefik.enable=false"
command:
- "redis-server"
- "--maxmemory ${REDIS_MEMORY_MAX}"
- "--maxmemory-policy allkeys-lru"
- "--logfile ${REDIS_LOG_FILE}"
restart: unless-stopped

networks:
internal:
driver: bridge
web:
external: true

volumes:
redis-data:
redis-logs:
driver_opts:
type: none
o: bind
device: ${PWD}/shared/logs/redis

0 comments on commit 66124bf

Please sign in to comment.