ai/at
1
0

fix docker compose

This commit is contained in:
2025-12-03 19:34:47 +09:00
parent fa7ff974b8
commit 183dd41f2e
2 changed files with 31 additions and 39 deletions

View File

@@ -48,8 +48,7 @@ services:
- ./envs/pds - ./envs/pds
volumes: volumes:
- ./data/pds/:/data/ - ./data/pds/:/data/
- ./repos/atproto/services/pds/index.js:/app/run-pds.js command: node --enable-source-maps index.js
command: ['node', '--enable-source-maps', '/app/run-pds.js']
depends_on: depends_on:
database: database:
condition: service_healthy condition: service_healthy
@@ -66,8 +65,7 @@ services:
user: root user: root
volumes: volumes:
- ./data/bsky/:/data/ - ./data/bsky/:/data/
- ./repos/atproto/services/bsky/api.js:/app/run-bsky.js command: node --enable-source-maps api.js
command: ['node', '--enable-source-maps', '/app/run-bsky.js']
depends_on: depends_on:
database: database:
condition: service_healthy condition: service_healthy

View File

@@ -18,6 +18,8 @@ function at-repos-env() {
https://github.com/bluesky-social/ozone https://github.com/bluesky-social/ozone
https://github.com/bluesky-social/jetstream https://github.com/bluesky-social/jetstream
) )
services=( bsky plc pds jetstream bgs ozone social-app )
img=( bsky plc pds jetstream bgs ozone social-app ozone-web ozone-daemon )
d=${0:a:h} d=${0:a:h}
dh=${0:a:h:h} dh=${0:a:h:h}
name=${host%%.*} name=${host%%.*}
@@ -236,48 +238,40 @@ function at-repos-ozone-patch() {
function at-repos-build-docker-atproto() { function at-repos-build-docker-atproto() {
cd $d cd $d
docker image prune -a docker image prune -a
docker compose build --no-cache bsky plc pds jetstream bgs ozone if [ -z "$1" ];then
for ((i=1; i<=${#services}; i++)); do
service=${services[$i]}
docker compose build --no-cache $service
done
else
docker compose build --no-cache $1
fi
} }
function at-repos-build-docker-social() { function at-repos-push-reset() {
cd $d
docker compose build --no-cache social-app
}
function at-repos-push-docker() {
docker restart registry docker restart registry
docker stop registry docker stop registry
docker rm registry docker rm registry
docker volume rm registry-data 2>/dev/null || true docker volume rm registry-data 2>/dev/null || true
docker run -d -p 5000:5000 --name registry \ docker run -d -p ${dport}:${dport} --name registry \
--restart=always \ --restart=always \
-v registry-data:/var/lib/registry \ -v registry-data:/var/lib/registry \
registry:2 registry:2
sleep 3 sleep 3
docker run -d -p ${dport}:${dport} --name registry --restart=always registry:2 docker run -d -p ${dport}:${dport} --name registry --restart=always registry:2
docker tag at-pds:latest localhost:${dport}/pds:latest }
docker tag at-ozone-web:latest localhost:${dport}/ozone-web:latest
docker tag at-bgs:latest localhost:${dport}/bgs:latest
docker tag at-jetstream:latest localhost:${dport}/jetstream:latest
docker tag at-bsky:latest localhost:${dport}/bsky:latest
docker tag at-ozone-daemon:latest localhost:${dport}/ozone-daemon:latest
docker tag at-ozone:latest localhost:${dport}/ozone:latest
docker tag at-plc:latest localhost:${dport}/plc:latest
docker tag at-social-app:latest localhost:${dport}/social-app:latest
docker push localhost:${dport}/pds:latest function at-repos-push-docker() {
docker push localhost:${dport}/ozone-web:latest if [ -z "$1" ];then
docker push localhost:${dport}/bgs:latest for ((i=1; i<=${#img}; i++)); do
docker push localhost:${dport}/jetstream:latest img=${imgs[$i]}
docker push localhost:${dport}/bsky:latest docker tag at-${img}:latest localhost:${dport}/${img}:latest
docker push localhost:${dport}/ozone-daemon:latest docker push localhost:${dport}/${img}:latest
docker push localhost:${dport}/ozone:latest done
docker push localhost:${dport}/plc:latest else
docker push localhost:${dport}/social-app:latest docker tag at-${1}:latest localhost:${dport}/${1}:latest
docker push localhost:${dport}/${1}:latest
cd $d fi
docker compose down
} }
function at-repos-pull-docker() { function at-repos-pull-docker() {
@@ -297,6 +291,7 @@ case "`cat /etc/hostname`" in
exit exit
;; ;;
*) *)
at-repos-push-reset
at-repos-clone at-repos-clone
at-repos-pull at-repos-pull
at-repos-social-app-icon at-repos-social-app-icon
@@ -315,15 +310,14 @@ case "`cat /etc/hostname`" in
at-repos-atproto-service-bsky-api-patch at-repos-atproto-service-bsky-api-patch
at-repos-atproto-service-pds-index-patch at-repos-atproto-service-pds-index-patch
at-repos-ozone-patch at-repos-ozone-patch
at-repos-build-docker-social if [ -n "$1" ];then
if [ -n "$1" ] && [ "$1" = "s" ];then at-repos-build-docker-atproto $1
docker run -d -p ${dport}:${dport} --name registry --restart=always registry:2 at-repos-push-docker $1
docker tag at-social-app:latest localhost:${dport}/social-app:latest
docker push localhost:${dport}/social-app:latest
exit exit
fi fi
at-repos-build-docker-atproto at-repos-build-docker-atproto
at-repos-push-docker at-repos-push-docker
cd $d; docker compose down
;; ;;
esac esac