Fix docker compose local network (#1809)
* fix #1502 docker-compose in local network * fix: docker-compose images versions * fix CADDY_DOMAIN and chalice env * add chalice line * domain name again * add caddy to common.env * remove chalice variable is_dns_public to SKIP_H_SSL
This commit is contained in:
parent
df2ee71bbb
commit
967b824501
4 changed files with 79 additions and 44 deletions
6
scripts/docker-compose/Caddyfile.private
Normal file
6
scripts/docker-compose/Caddyfile.private
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{$CADDY_DOMAIN} {
|
||||||
|
reverse_proxy nginx-openreplay:80
|
||||||
|
tls {
|
||||||
|
issuer internal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- pgdata:/var/lib/postgresql/data
|
- pgdata:/var/lib/postgresql/data
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
environment:
|
environment:
|
||||||
POSTGRESQL_PASSWORD: ${COMMON_PG_PASSWORD}
|
POSTGRESQL_PASSWORD: ${COMMON_PG_PASSWORD}
|
||||||
|
|
||||||
|
|
@ -17,7 +17,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- redisdata:/var/lib/postgresql/data
|
- redisdata:/var/lib/postgresql/data
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
environment:
|
environment:
|
||||||
ALLOW_EMPTY_PASSWORD: "yes"
|
ALLOW_EMPTY_PASSWORD: "yes"
|
||||||
|
|
||||||
|
|
@ -27,7 +27,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- miniodata:/bitnami/minio/data
|
- miniodata:/bitnami/minio/data
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
ports:
|
ports:
|
||||||
- 9001:9001
|
- 9001:9001
|
||||||
environment:
|
environment:
|
||||||
|
|
@ -48,6 +48,7 @@ services:
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
chown -R 1001:1001 /mnt/{efs,minio,postgres}
|
chown -R 1001:1001 /mnt/{efs,minio,postgres}
|
||||||
|
restart: on-failure
|
||||||
|
|
||||||
minio-migration:
|
minio-migration:
|
||||||
image: bitnami/minio:2020.10.9-debian-10-r6
|
image: bitnami/minio:2020.10.9-debian-10-r6
|
||||||
|
|
@ -58,7 +59,7 @@ services:
|
||||||
- minio
|
- minio
|
||||||
- fs-permission
|
- fs-permission
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
volumes:
|
volumes:
|
||||||
- ../helmcharts/openreplay/files/minio.sh:/tmp/minio.sh
|
- ../helmcharts/openreplay/files/minio.sh:/tmp/minio.sh
|
||||||
environment:
|
environment:
|
||||||
|
|
@ -87,7 +88,7 @@ services:
|
||||||
- postgresql
|
- postgresql
|
||||||
- minio-migration
|
- minio-migration
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
volumes:
|
volumes:
|
||||||
- ../schema/db/init_dbs/postgresql/init_schema.sql:/tmp/init_schema.sql
|
- ../schema/db/init_dbs/postgresql/init_schema.sql:/tmp/init_schema.sql
|
||||||
environment:
|
environment:
|
||||||
|
|
@ -108,63 +109,63 @@ services:
|
||||||
psql -v ON_ERROR_STOP=1 -f /tmp/init_schema.sql
|
psql -v ON_ERROR_STOP=1 -f /tmp/init_schema.sql
|
||||||
|
|
||||||
frontend-openreplay:
|
frontend-openreplay:
|
||||||
image: public.ecr.aws/p1t3u8a3/frontend:v1.16.0
|
image: public.ecr.aws/p1t3u8a3/frontend:${COMMON_VERSION}
|
||||||
container_name: frontend
|
container_name: frontend
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
alerts-openreplay:
|
alerts-openreplay:
|
||||||
image: public.ecr.aws/p1t3u8a3/alerts:v1.16.0
|
image: public.ecr.aws/p1t3u8a3/alerts:${COMMON_VERSION}
|
||||||
container_name: alerts
|
container_name: alerts
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
env_file:
|
env_file:
|
||||||
- alerts.env
|
- alerts.env
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
assets-openreplay:
|
assets-openreplay:
|
||||||
image: public.ecr.aws/p1t3u8a3/assets:v1.16.0
|
image: public.ecr.aws/p1t3u8a3/assets:${COMMON_VERSION}
|
||||||
container_name: assets
|
container_name: assets
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
env_file:
|
env_file:
|
||||||
- assets.env
|
- assets.env
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
assist-openreplay:
|
assist-openreplay:
|
||||||
image: public.ecr.aws/p1t3u8a3/assist:v1.16.0
|
image: public.ecr.aws/p1t3u8a3/assist:${COMMON_VERSION}
|
||||||
container_name: assist
|
container_name: assist
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
env_file:
|
env_file:
|
||||||
- assist.env
|
- assist.env
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
db-openreplay:
|
db-openreplay:
|
||||||
image: public.ecr.aws/p1t3u8a3/db:v1.16.0
|
image: public.ecr.aws/p1t3u8a3/db:${COMMON_VERSION}
|
||||||
container_name: db
|
container_name: db
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
ender-openreplay:
|
ender-openreplay:
|
||||||
image: public.ecr.aws/p1t3u8a3/ender:v1.16.0
|
image: public.ecr.aws/p1t3u8a3/ender:${COMMON_VERSION}
|
||||||
container_name: ender
|
container_name: ender
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
env_file:
|
env_file:
|
||||||
- ender.env
|
- ender.env
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
heuristics-openreplay:
|
heuristics-openreplay:
|
||||||
image: public.ecr.aws/p1t3u8a3/heuristics:v1.16.0
|
image: public.ecr.aws/p1t3u8a3/heuristics:${COMMON_VERSION}
|
||||||
domainname: app.svc.cluster.local
|
domainname: app.svc.cluster.local
|
||||||
container_name: heuristics
|
container_name: heuristics
|
||||||
networks:
|
networks:
|
||||||
opereplay-net:
|
openreplay-net:
|
||||||
aliases:
|
aliases:
|
||||||
- heuristics-openreplay.app.svc.cluster.local
|
- heuristics-openreplay.app.svc.cluster.local
|
||||||
env_file:
|
env_file:
|
||||||
|
|
@ -172,88 +173,88 @@ services:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
imagestorage-openreplay:
|
imagestorage-openreplay:
|
||||||
image: public.ecr.aws/p1t3u8a3/imagestorage:v1.16.0
|
image: public.ecr.aws/p1t3u8a3/imagestorage:${COMMON_VERSION}
|
||||||
container_name: imagestorage
|
container_name: imagestorage
|
||||||
env_file:
|
env_file:
|
||||||
- imagestorage.env
|
- imagestorage.env
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
integrations-openreplay:
|
integrations-openreplay:
|
||||||
image: public.ecr.aws/p1t3u8a3/integrations:v1.16.0
|
image: public.ecr.aws/p1t3u8a3/integrations:${COMMON_VERSION}
|
||||||
container_name: integrations
|
container_name: integrations
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
env_file:
|
env_file:
|
||||||
- integrations.env
|
- integrations.env
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
peers-openreplay:
|
peers-openreplay:
|
||||||
image: public.ecr.aws/p1t3u8a3/peers:v1.16.0
|
image: public.ecr.aws/p1t3u8a3/peers:${COMMON_VERSION}
|
||||||
container_name: peers
|
container_name: peers
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
env_file:
|
env_file:
|
||||||
- peers.env
|
- peers.env
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
sourcemapreader-openreplay:
|
sourcemapreader-openreplay:
|
||||||
image: public.ecr.aws/p1t3u8a3/sourcemapreader:v1.16.0
|
image: public.ecr.aws/p1t3u8a3/sourcemapreader:${COMMON_VERSION}
|
||||||
container_name: sourcemapreader
|
container_name: sourcemapreader
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
env_file:
|
env_file:
|
||||||
- sourcemapreader.env
|
- sourcemapreader.env
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
videostorage-openreplay:
|
videostorage-openreplay:
|
||||||
image: public.ecr.aws/p1t3u8a3/videostorage:v1.16.0
|
image: public.ecr.aws/p1t3u8a3/videostorage:${COMMON_VERSION}
|
||||||
container_name: videostorage
|
container_name: videostorage
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
env_file:
|
env_file:
|
||||||
- videostorage.env
|
- videostorage.env
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
http-openreplay:
|
http-openreplay:
|
||||||
image: public.ecr.aws/p1t3u8a3/http:v1.16.0
|
image: public.ecr.aws/p1t3u8a3/http:${COMMON_VERSION}
|
||||||
container_name: http
|
container_name: http
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
env_file:
|
env_file:
|
||||||
- http.env
|
- http.env
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
chalice-openreplay:
|
chalice-openreplay:
|
||||||
image: public.ecr.aws/p1t3u8a3/chalice:v1.16.0
|
image: public.ecr.aws/p1t3u8a3/chalice:${COMMON_VERSION}
|
||||||
container_name: chalice
|
container_name: chalice
|
||||||
volumes:
|
volumes:
|
||||||
- shared-volume:/mnt/efs
|
- shared-volume:/mnt/efs
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
env_file:
|
env_file:
|
||||||
- chalice.env
|
- chalice.env
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
sink-openreplay:
|
sink-openreplay:
|
||||||
image: public.ecr.aws/p1t3u8a3/sink:v1.16.0
|
image: public.ecr.aws/p1t3u8a3/sink:${COMMON_VERSION}
|
||||||
container_name: sink
|
container_name: sink
|
||||||
volumes:
|
volumes:
|
||||||
- shared-volume:/mnt/efs
|
- shared-volume:/mnt/efs
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
env_file:
|
env_file:
|
||||||
- sink.env
|
- sink.env
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
storage-openreplay:
|
storage-openreplay:
|
||||||
image: public.ecr.aws/p1t3u8a3/storage:v1.16.0
|
image: public.ecr.aws/p1t3u8a3/storage:${COMMON_VERSION}
|
||||||
container_name: storage
|
container_name: storage
|
||||||
volumes:
|
volumes:
|
||||||
- shared-volume:/mnt/efs
|
- shared-volume:/mnt/efs
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
env_file:
|
env_file:
|
||||||
- storage.env
|
- storage.env
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
@ -262,7 +263,7 @@ services:
|
||||||
image: nginx:latest
|
image: nginx:latest
|
||||||
container_name: nginx
|
container_name: nginx
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
volumes:
|
volumes:
|
||||||
- ./nginx.conf:/etc/nginx/conf.d/default.conf
|
- ./nginx.conf:/etc/nginx/conf.d/default.conf
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
@ -279,10 +280,10 @@ services:
|
||||||
- caddy_data:/data
|
- caddy_data:/data
|
||||||
- caddy_config:/config
|
- caddy_config:/config
|
||||||
networks:
|
networks:
|
||||||
- opereplay-net
|
- openreplay-net
|
||||||
environment:
|
environment:
|
||||||
- ACME_AGREE=true # Agree to Let's Encrypt Subscriber Agreement
|
- ACME_AGREE=true # Agree to Let's Encrypt Subscriber Agreement
|
||||||
- CADDY_DOMAIN=or-foss.rjsh.me
|
- CADDY_DOMAIN=${CADDY_DOMAIN}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -295,4 +296,4 @@ volumes:
|
||||||
caddy_config:
|
caddy_config:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
opereplay-net:
|
openreplay-net:
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,21 @@ if [[ -z $DOMAIN_NAME ]]; then
|
||||||
fatal "DOMAIN_NAME variable is empty. Please provide a valid domain name to proceed."
|
fatal "DOMAIN_NAME variable is empty. Please provide a valid domain name to proceed."
|
||||||
fi
|
fi
|
||||||
info "Using domain name: $DOMAIN_NAME 🌐"
|
info "Using domain name: $DOMAIN_NAME 🌐"
|
||||||
|
echo "CADDY_DOMAIN=\"$DOMAIN_NAME\"" >> common.env
|
||||||
|
|
||||||
|
read -p "Is the domain on a public DNS? (y/n) " yn
|
||||||
|
case $yn in
|
||||||
|
y ) echo "$DOMAIN_NAME is on a public DNS";
|
||||||
|
;;
|
||||||
|
n ) echo "$DOMAIN_NAME is on a private DNS";
|
||||||
|
#add TLS internal to caddyfile
|
||||||
|
#In local network Caddy can't reach Let's Encrypt servers to get a certificate
|
||||||
|
mv Caddyfile Caddyfile.public
|
||||||
|
mv Caddyfile.private Caddyfile
|
||||||
|
;;
|
||||||
|
* ) echo invalid response;
|
||||||
|
exit 1;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Create passwords if they don't exist
|
# Create passwords if they don't exist
|
||||||
create_passwords
|
create_passwords
|
||||||
|
|
@ -87,8 +102,21 @@ set +a
|
||||||
|
|
||||||
# Use the `envsubst` command to substitute the shell environment variables into reference_var.env and output to a combined .env
|
# Use the `envsubst` command to substitute the shell environment variables into reference_var.env and output to a combined .env
|
||||||
find ./ -type f \( -iname "*.env" -o -iname "docker-compose.yaml" \) ! -name "common.env" -exec /bin/bash -c 'file="{}"; git checkout -- "$file"; cp "$file" "$file.bak"; envsubst < "$file.bak" > "$file"; rm "$file.bak"' \;
|
find ./ -type f \( -iname "*.env" -o -iname "docker-compose.yaml" \) ! -name "common.env" -exec /bin/bash -c 'file="{}"; git checkout -- "$file"; cp "$file" "$file.bak"; envsubst < "$file.bak" > "$file"; rm "$file.bak"' \;
|
||||||
sudo -E docker-compose pull --no-parallel
|
|
||||||
sudo -E docker compose --profile migration up -d
|
case $yn in
|
||||||
|
y ) echo "$DOMAIN_NAME is on a public DNS";
|
||||||
|
##No changes needed
|
||||||
|
;;
|
||||||
|
n ) echo "$DOMAIN_NAME is on a private DNS";
|
||||||
|
##Add a variable to chalice.env file
|
||||||
|
echo "SKIP_H_SSL=True" >> chalice.env
|
||||||
|
;;
|
||||||
|
* ) echo invalid response;
|
||||||
|
exit 1;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
sudo -E docker-compose --parallel 1 pull
|
||||||
|
sudo -E docker-compose --profile migration up --force-recreate --build -d
|
||||||
cp common.env common.env.bak
|
cp common.env common.env.bak
|
||||||
echo "🎉🎉🎉 Done! 🎉🎉🎉"
|
echo "🎉🎉🎉 Done! 🎉🎉🎉"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue