-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
73 additions
and
0 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,20 @@ | ||
#!/bin/bash | ||
|
||
### INSTALL DOCKER & DOCKER COMPOSE | ||
# https://docs.docker.com/engine/install/ubuntu | ||
|
||
sudo apt-get update | ||
sudo apt-get install ca-certificates curl | ||
sudo install -m 0755 -d /etc/apt/keyrings | ||
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc | ||
sudo chmod a+r /etc/apt/keyrings/docker.asc | ||
|
||
echo \ | ||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ | ||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | ||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
|
||
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin | ||
|
||
# Start docker service | ||
sudo systemctl start docker |
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,53 @@ | ||
services: | ||
konecty-mongodb: | ||
image: mongo:6 | ||
container_name: konecty-mongodb | ||
restart: always | ||
env_file: | ||
- .env | ||
ports: | ||
- '${MONGO_PORT:-27017}:27017' | ||
command: ['mongod', '--bind_ip_all', '--replSet', 'rs0'] | ||
|
||
konecty-mongodb-init: | ||
image: mongo:6 | ||
container_name: konecty-mongodb-init | ||
depends_on: | ||
- konecty-mongodb | ||
command: | ||
- /bin/bash | ||
- -c | ||
- | | ||
echo 'Waiting 10 seconds before checking replica set status'; | ||
sleep 10; | ||
echo 'Checking replica set status'; | ||
if ! mongosh --host konecty-mongodb --eval 'rs.status()' | grep "set: 'rs0'"; then | ||
echo 'Initiating replica set'; | ||
mongosh --host konecty-mongodb --eval 'rs.initiate({_id : "rs0", members: [ { _id: 0, host: "konecty-mongodb:27017" } ] })'; | ||
else | ||
echo 'Replica set already initialized'; | ||
fi | ||
cloudflared: | ||
image: cloudflare/cloudflared:latest | ||
container_name: cloudflared | ||
command: tunnel --no-autoupdate run --token ${CLOUDFLARED_TOKEN} | ||
|
||
konecty: | ||
container_name: konecty | ||
image: konecty/konecty:2.2.1 | ||
ports: | ||
- '${PORT:-3000}:${PORT:-3000}' | ||
env_file: | ||
- .env | ||
environment: | ||
- MONGO_URL=mongodb://konecty-mongodb:27017/${KONMETA_NAMESPACE}?directConnection=true | ||
depends_on: | ||
konecty-mongodb-init: | ||
condition: service_completed_successfully | ||
healthcheck: | ||
test: ['CMD', 'curl', '-f', 'http://localhost:${PORT:-3000}/liveness'] | ||
interval: 30s | ||
timeout: 10s | ||
retries: 3 | ||
start_period: 20s |