-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made docker dev setup more accessible, added Quickstart to docs.
- Loading branch information
Showing
3 changed files
with
82 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [ -f .env ]; then | ||
export `grep -v '^#' .env | xargs` | ||
else | ||
export DEV_UID=$(id -u) DEV_GID=$(id -g) LOCAL_DEV_CHECK=1 | ||
fi | ||
|
||
COMPOSE_FILE=docker-compose.yml | ||
|
||
if [ $# -eq 0 ]; then | ||
echo "Usage: bin/compose <command> [args*]" | ||
echo | ||
echo "Commands:" | ||
echo " setup - Has to be run once intially. Installs backend and frontend dependencies. " | ||
echo " start - Starts both backend and frontend in the background. Acccess via http://localhost:3000/ by default." | ||
echo " run - Starts the frontend in the backround and backend in the foreground. Useful for debugging using pry." | ||
echo " * - Everything else will be passed straight to \`docker-compose\`." | ||
echo | ||
|
||
exit 1 | ||
elif [[ "$@" = "start" ]]; then | ||
# backend will be started automatically as a dependency of the frontend | ||
docker-compose -f $COMPOSE_FILE up -d frontend | ||
elif [[ "$@" = "run" ]]; then | ||
docker-compose -f $COMPOSE_FILE up -d frontend | ||
docker-compose -f $COMPOSE_FILE stop backend | ||
docker-compose -f $COMPOSE_FILE run -p ${PORT:-3000}:3000 backend # run backend in TTY so you can debug using pry for instance | ||
elif [[ "$1" = "setup" ]]; then | ||
docker-compose -f $COMPOSE_FILE run backend setup | ||
yes no | docker-compose -f $COMPOSE_FILE run frontend npm install | ||
else | ||
docker-compose -f $COMPOSE_FILE $* | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters