Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docker/docker-compose.indexable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ services:
postgres:
networks:
- api_indexable_network
redis:
networks:
- api_indexable_network

networks:
api_indexable_network:
Expand Down
8 changes: 8 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,11 @@ services:
POSTGRES_PASSWORD: beanstalk
volumes:
- ./.data/${DOCKER_ENV}/postgres:/var/lib/postgresql/data
redis:
image: redis:8-alpine
ports:
- "${REDIS_PORT}:6379"
command: ["redis-server", "--appendonly", "yes"]
volumes:
- ./.data/${DOCKER_ENV}/redis:/data
restart: unless-stopped
9 changes: 6 additions & 3 deletions docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ cd $(dirname "$0")
DOCKER_ENV=$1
KOAJS_PORT=$2
POSTGRES_PORT=$3
SERVICE=$4
if [ -z "$DOCKER_ENV" ] || [ -z "$KOAJS_PORT" ] || [ -z "$POSTGRES_PORT" ]; then
REDIS_PORT=$4
SERVICES=("${@:5}")
if [ -z "$DOCKER_ENV" ] || [ -z "$KOAJS_PORT" ] || [ -z "$POSTGRES_PORT" ] || [ -z "$REDIS_PORT" ]; then
DOCKER_ENV="dev"
KOAJS_PORT="4000"
POSTGRES_PORT="6432"
REDIS_PORT="7379"
fi

export DOCKER_ENV
export KOAJS_PORT
export POSTGRES_PORT
export REDIS_PORT

# Can optionally provide a specific service to start. Defaults to all
docker compose \
-p web-api-$DOCKER_ENV \
-f docker-compose.yml \
${DOCKER_ENV:+$([[ "$DOCKER_ENV" == "local" ]] && echo "-f docker-compose.indexable.yml")} \
up -d ${SERVICE:+$SERVICE}
up -d "${SERVICES[@]}"
Loading