Skip to content

Commit

Permalink
fix docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
simlarsen committed Dec 7, 2022
1 parent b92e5cb commit 1d29703
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Alert/.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ONEUPTIME_SECRET=ae60cf8f0cec2df8d05aaf0b
ONEUPTIME_SECRET=fd57b59aa8f3f516d2f6cb06
2 changes: 1 addition & 1 deletion Ci/spec/e2e/docker-compose-enterprise-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ e2e_docker_compose_enterprise_test:
# Install Docker Compose.
- sudo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
- sudo docker-compose down -v
- sudo docker compose down -v
# Install the cluster.
- chmod +x ./env-setup.sh
- ./env-setup.sh
Expand Down
2 changes: 1 addition & 1 deletion Ci/spec/e2e/docker-compose-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ e2e_docker_compose_test:
# Install Docker Compose.
- sudo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
- sudo docker-compose down -v
- sudo docker compose down -v
- export BILLING_ENABLED=true
# Install the cluster.
- chmod +x ./env-setup.sh
Expand Down
2 changes: 1 addition & 1 deletion CommonServer/test-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ cd ..
# Run Preinstall.
npm run prerun
# Run Postgres
docker-compose up -d postgres
docker compose up -d postgres
2 changes: 1 addition & 1 deletion Docs/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ npm run logs-dev accounts
## Running on: on-prem, staging, or production.

### Running with Docker Compose:
- Run `docker-compose up`
- Run `docker compose up`

### Running with Kubernetes and Helm
- Please check `README.md` in the `HelmChart` folder.
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ bash preinstall.sh
# Pull latest changes
git pull

docker-compose pull
docker compose pull

# echo "Checking if async migrations are up to date"
# sudo -E docker-compose run init
# sudo -E docker compose run init

npm run start

Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@
"lint": "ejslint home/views/*.ejs && eslint '**/*.ts*' -c .eslintrc.json --ignore-path .eslintignore ",
"fix-lint": " node --max_old_space_size=18192 ./node_modules/.bin/eslint '**/*.ts*' -c .eslintrc.json --ignore-path .eslintignore --fix ",
"fix": "npm run fix-lint",
"start": "docker-compose up -d $npm_config_services",
"ps": "docker-compose ps",
"logs": "docker-compose logs --tail=100 -f $npm_config_services",
"write-logs": "docker-compose logs -f $npm_config_services > logs.txt",
"force-build": "npm run prerun && docker-compose build --no-cache $npm_config_services",
"start": "docker compose up -d $npm_config_services",
"ps": "docker compose ps",
"logs": "docker compose logs --tail=100 -f $npm_config_services",
"write-logs": "docker compose logs -f $npm_config_services > logs.txt",
"force-build": "npm run prerun && docker compose build --no-cache $npm_config_services",
"force-build-dev": "npm run config-to-dev && npm run force-build",
"kill": "npm run stop",
"prod": "npm run prerun && docker-compose up -d",
"prod": "npm run prerun && docker compose up -d",
"dev": "npm run config-to-dev && npm run prerun && npm run start $npm_config_services",
"stop": "docker-compose down --remove-orphans",
"stop": "docker compose down --remove-orphans",
"prune": "docker system prune",
"remove-all-containers": "docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q) || echo 'No running containers'",
"prepare": "husky install"
Expand Down
11 changes: 2 additions & 9 deletions preinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,13 @@ fi
# enable docker without sudo
sudo usermod -aG docker "${USER}" || true

if [[ ! $(which docker-compose) && ! $(docker-compose --version) ]]; then
if [[ ! $(which docker-compose) && ! $(docker compose --version) ]]; then
mkdir -p /usr/local/lib/docker/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/lib/docker/cli-plugins
sudo curl -SL https://github.com/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/lib/docker/cli-plugins/docker-compose
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
docker compose version
fi

# If docker still fails to install, then quit.
if [[ ! $(which docker-compose) && ! $(docker-compose --version) ]]; then
echo -e "Failed to install docker-domcpose. Please install Docker Compose manually here: https://docs.docker.com/compose/install/linux/#install-the-plugin-manually."
echo -e "Exiting the OneUptime installer."
exit
fi

if [[ ! $(which gomplate) ]]; then
ARCHITECTURE=$(uname -m)

Expand Down
4 changes: 2 additions & 2 deletions uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ fi


echo "Uninstalling OneUptime..."
sudo docker-compose down
sudo docker-compose rm
sudo docker compose down
sudo docker compose rm
echo "OneUptime uninstalled."
echo "We would like to hear your feedback to make this product better for you and for other users, please email us at [email protected]."
echo " - If you notice a bug, we will fix it for you."
Expand Down

0 comments on commit 1d29703

Please sign in to comment.