Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dev): update docker compose #126

Merged
merged 1 commit into from
Aug 26, 2024
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
22 changes: 11 additions & 11 deletions tools/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ services:
# platforms:
# - "linux/amd64"
# - "linux/arm64"
container_name: muse-server
container_name: "${MUSE_SERVER_IMAGE:-muse-server}"
ports:
- ${SERVER_PORT}:8080
- ${SERVER_DEBUG_PORT}:5005
Expand All @@ -45,16 +45,16 @@ services:
postgres:
condition: service_healthy

muse-client:
image: "${MUSE_CLIENT_IMAGE:-muse-client}"
# platforms:
# - "linux/amd64"
# - "linux/arm64"
container_name: muse-client
ports:
- ${CLIENT_PORT}:80
networks:
- muse
# muse-client:
# image: "${MUSE_CLIENT_IMAGE:-muse-client}"
## platforms:
## - "linux/amd64"
## - "linux/arm64"
# container_name: "${MUSE_CLIENT_IMAGE:-muse-client}"
# ports:
# - ${CLIENT_PORT}:80
# networks:
# - muse

# muse-client-dev:
# image: "${MUSE_CLIENT_DEV_IMAGE:-muse-client-dev}"
Expand Down
4 changes: 2 additions & 2 deletions tools/docker/env/dev.env
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
SERVER_PORT=50505
SERVER_PORT=10001
SERVER_DEBUG_PORT=50504

CLIENT_PORT=50001
CLIENT_DEV_PORT=3001
CLIENT_DEV_PORT=3003

POSTGRES_PORT=5555
POSTGRES_USER=muse
Expand Down
2 changes: 1 addition & 1 deletion tools/docker/env/local.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SERVER_PORT=8080
SERVER_PORT=9000
SERVER_DEBUG_PORT=5005

CLIENT_PORT=3000
Expand Down
12 changes: 6 additions & 6 deletions tools/scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ if [ -z "$SSH_PASS" ]; then
exit 1
fi

dockerRepository=$1
stage=$1

if [ -z "$1" ]
then
echo -e "\033[0;33mNo Docker Hub username provided. 'myshx' will be used.\033[0m"
dockerRepository="myshx"
echo -e "\033[0;33mNo stage provided. 'DEV' stage will be used.\033[0m"
stage="dev"
fi

stage=$2
dockerRepository=$2

if [ -z "$2" ]
then
echo -e "\033[0;33mNo stage provided. 'DEV' stage will be used.\033[0m"
stage="dev"
echo -e "\033[0;33mNo Docker Hub username provided. 'myshx' will be used.\033[0m"
dockerRepository="myshx"
fi

dockerTag="$stage-$(git rev-parse --short HEAD)"
Expand Down
32 changes: 27 additions & 5 deletions tools/scripts/runLocal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,32 @@ set -e
currentDir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
rootDir="$currentDir/../../"

(cd "$rootDir" && exec ./tools/scripts/stop.sh)
(cd "$rootDir" && exec ./tools/scripts/clean.sh)
(cd "$rootDir" && exec ./tools/scripts/buildAndPush.sh)
(cd "$rootDir" && exec ./tools/scripts/run.sh)
stage=$1

dockerTag="latest"
if [ -z "$1" ]
then
echo -e "\033[0;33mNo stage provided. 'local' stage will be used.\033[0m"
stage="local"
dockerTag="$stage-$(git rev-parse --short HEAD)"
fi

dockerRepository=$2

if [ -z "$2" ]
then
echo -e "\033[0;33mNo Docker Hub username provided. 'myshx' will be used.\033[0m"
dockerRepository="myshx"
fi

(cd "$rootDir" && exec ./tools/scripts/stop.sh "$stage")
(cd "$rootDir" && exec ./tools/scripts/clean.sh "$stage")
(cd "$rootDir" && exec ./tools/scripts/buildAndPush.sh "$dockerRepository" "$dockerTag")

MUSE_SERVER_IMAGE="$dockerRepository/muse-server:$dockerTag"
MUSE_CLIENT_IMAGE="$dockerRepository/muse-client:$dockerTag"
MUSE_CLIENT_DEV_IMAGE="$dockerRepository/muse-client-dev:$dockerTag"
(cd "$rootDir" && exec ./tools/scripts/run.sh "$stage")

echo -e "\033[0;32mList of available ports:\n\033[0m"
(cd "$rootDir" && exec cat ./tools/docker/env/local.env)
(cd "$rootDir" && exec cat ./tools/docker/env/$stage.env)
3 changes: 1 addition & 2 deletions tools/scripts/stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ if [ -z "$1" ]
stage="local"
fi


(cd "$rootDir" && exec docker compose \
-f ./tools/docker/docker-compose.yml \
--env-file ./tools/docker/env/$stage.env \
--project-name=muse-$stage \
rm -f)
down -v)

echo -e "\033[0;32mDocker Service has been stopped.\033[0m"
Loading