Skip to content

Commit

Permalink
fix: use docker compose instead of docker-compose
Browse files Browse the repository at this point in the history
Signed-off-by: Gábor Boros <[email protected]>
  • Loading branch information
gabor-boros committed Apr 22, 2024
1 parent 77ef2fd commit 94df5fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ build: generate dep build.backend ## Build the project

.PHONY: build.backend
build.backend: ## Build service
docker-compose -f deploy/docker/docker-compose.yml build --no-cache
docker compose -f deploy/docker/docker-compose.yml build --no-cache

.PHONY: build.monitoring
build.monitoring: ## Build service
docker-compose -f deploy/docker/docker-compose.monitoring.yml build
docker compose -f deploy/docker/docker-compose.monitoring.yml build

.PHONY: generate
generate: generate.openapi generate.email ## Generate code
Expand All @@ -53,27 +53,27 @@ generate.email: ## Generate email templates

.PHONY: start.backend
start.backend: ## Start service
docker-compose -f deploy/docker/docker-compose.yml up --build -d --force-recreate
docker compose -f deploy/docker/docker-compose.yml up --build -d --force-recreate

.PHONY: start.monitoring
start.monitoring: ## Start service
docker-compose -f deploy/docker/docker-compose.monitoring.yml up --build -d
docker compose -f deploy/docker/docker-compose.monitoring.yml up --build -d

.PHONY: stop.backend
stop.backend: ## Halt service
docker-compose -f deploy/docker/docker-compose.yml stop
docker compose -f deploy/docker/docker-compose.yml stop

.PHONY: stop.monitoring
stop.monitoring: ## Halt service
docker-compose -f deploy/docker/docker-compose.monitoring.yml stop
docker compose -f deploy/docker/docker-compose.monitoring.yml stop

.PHONY: destroy.backend
destroy.backend: ## Remove service resources
docker-compose -f deploy/docker/docker-compose.yml down --rmi local --volumes
docker compose -f deploy/docker/docker-compose.yml down --rmi local --volumes

.PHONY: destroy.monitoring
destroy.monitoring: ## Remove service resources
docker-compose -f deploy/docker/docker-compose.monitoring.yml down --rmi local --volumes
docker compose -f deploy/docker/docker-compose.monitoring.yml down --rmi local --volumes

.PHONY: bench
bench: bench.backend ## Run all benchmarks
Expand Down
17 changes: 8 additions & 9 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export ELEMO_CONFIG="${DEV_CONFIG_DIR}/config.local.gen.yml"

function checkInstalled() {
local program="${1}"

if ! type "${program}"; then
echo "Couldn't find ${program} in your PATH. Make sure it is installed."
exit 1
Expand All @@ -35,12 +35,12 @@ function backupCopyFile() {
}

function setupOAuthClient() {
docker-compose -f "${DOCKER_DEPLOY_DIR}/docker-compose.yml" up postgres --remove-orphans -d
docker compose -f "${DOCKER_DEPLOY_DIR}/docker compose.yml" up postgres --remove-orphans -d
waitAndPrint 5

go run "${CMD_DIR}/main.go" auth add-client --callback-url http://127.0.0.1:3000/api/auth/callback/elemo --public 2>&1
ADD_CLIENT_OUT=$(go run "${CMD_DIR}/main.go" auth add-client --callback-url http://127.0.0.1:3000/api/auth/callback/elemo --public 2>&1 | grep "client-id")
docker-compose -f "${DOCKER_DEPLOY_DIR}/docker-compose.yml" down
docker compose -f "${DOCKER_DEPLOY_DIR}/docker compose.yml" down

backupCopyFile "${WEB_DIR}/.env" "${WEB_DIR}/.env.example"
backupCopyFile "${WEB_DIR}/.env.test.local" "${WEB_DIR}/.env.test.example"
Expand All @@ -51,13 +51,13 @@ function setupOAuthClient() {
}

function setupDemoData() {
docker-compose -f "${DOCKER_DEPLOY_DIR}/docker-compose.yml" up neo4j --remove-orphans -d
docker compose -f "${DOCKER_DEPLOY_DIR}/docker compose.yml" up neo4j --remove-orphans -d
waitAndPrint 5

echo "MATCH (n) DETACH DELETE n" | docker-compose -f "${DOCKER_DEPLOY_DIR}/docker-compose.yml" exec -T neo4j cypher-shell -u "neo4j" -p "neo4jsecret"
docker-compose -f "${DOCKER_DEPLOY_DIR}/docker-compose.yml" exec -T neo4j cypher-shell -u "neo4j" -p "neo4jsecret" < "${QUERIES_DIR}/bootstrap.cypher"
docker-compose -f "${DOCKER_DEPLOY_DIR}/docker-compose.yml" exec -T neo4j cypher-shell -u "neo4j" -p "neo4jsecret" < "${QUERIES_DIR}/demo.cypher"
docker-compose -f "${DOCKER_DEPLOY_DIR}/docker-compose.yml" down
echo "MATCH (n) DETACH DELETE n" | docker compose -f "${DOCKER_DEPLOY_DIR}/docker compose.yml" exec -T neo4j cypher-shell -u "neo4j" -p "neo4jsecret"
docker compose -f "${DOCKER_DEPLOY_DIR}/docker compose.yml" exec -T neo4j cypher-shell -u "neo4j" -p "neo4jsecret" < "${QUERIES_DIR}/bootstrap.cypher"
docker compose -f "${DOCKER_DEPLOY_DIR}/docker compose.yml" exec -T neo4j cypher-shell -u "neo4j" -p "neo4jsecret" < "${QUERIES_DIR}/demo.cypher"
docker compose -f "${DOCKER_DEPLOY_DIR}/docker compose.yml" down
}

function installFrontEnd() {
Expand All @@ -69,7 +69,6 @@ function installFrontEnd() {
# Run preflight
checkInstalled "certutil"
checkInstalled "docker"
checkInstalled "docker-compose"
checkInstalled "go"
checkInstalled "jq"
checkInstalled "mkcert"
Expand Down

0 comments on commit 94df5fa

Please sign in to comment.