Skip to content

Commit

Permalink
Implemented selected services to docker-compose up per #30 and #13.
Browse files Browse the repository at this point in the history
  • Loading branch information
icasimpan committed Apr 29, 2022
1 parent 534e2a0 commit d0c54aa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions conf/env.sample
Expand Up @@ -32,7 +32,7 @@ DOCKER_CONTAINER_PREFIX=example
## It is OFF by default. Enable it by making its value 1
AUTOSTART_PROJECT=0

## SERVICES_TO_START - Useful if you're using laradock or other dev environment with a lot of services
## DOCKTIE_SERVICES_TO_START - Useful if you're using laradock or other dev environment with a lot of services
## and you want to just run a few of them.
#~SERVICES_TO_START="nginx php-fpm mysql"
SERVICES_TO_START=""
#~DOCKTIE_SERVICES_TO_START="nginx php-fpm mysql"
DOCKTIE_SERVICES_TO_START=""
3 changes: 2 additions & 1 deletion init.sh
Expand Up @@ -82,7 +82,8 @@ if [[ "$(docker-compose -f ${DOCKTIE_DOCKER_COMPOSE_FULLPATH} ps | tail -n +2 |
##
else
if [[ "$AUTOSTART_PROJECT" = "1" ]]; then
$DOCKTIE_DOCKER_COMPOSE_BIN -f $DOCKTIE_DOCKER_COMPOSE_FULLPATH up -d $SERVICES_TO_START
export DOCKTIE_SERVICES_TO_START="$DOCKTIE_SERVICES_TO_START" ## Needed in docker-compose wrapper
$DOCKTIE_DOCKER_COMPOSE_BIN -f $DOCKTIE_DOCKER_COMPOSE_FULLPATH up -d $DOCKTIE_SERVICES_TO_START
BOOTSTRAP_DOCKTIE
else
echo "ERROR: ${PROJECT_NAME} container(s) not running."
Expand Down
10 changes: 9 additions & 1 deletion utils/bin/docker-compose
@@ -1,3 +1,11 @@
#!/bin/bash

$DOCKTIE_DOCKER_COMPOSE_BIN -f $DOCKTIE_DOCKER_COMPOSE_FULLPATH $*
COMMON_DOCKER_COMPOSE="$DOCKTIE_DOCKER_COMPOSE_BIN -f $DOCKTIE_DOCKER_COMPOSE_FULLPATH"

## Make sure to 'up' only services as specificed in conf/*_env file
if [[ "$1" = 'up' ]]; then
shift
$COMMON_DOCKER_COMPOSE up $* $DOCKTIE_SERVICES_TO_START
else
$COMMON_DOCKER_COMPOSE $*
fi

0 comments on commit d0c54aa

Please sign in to comment.