From a866b3424dd8fe22c8120ecc2a7e46ae821ce864 Mon Sep 17 00:00:00 2001
From: SleeplessOne1917 <abias1122@gmail.com>
Date: Wed, 20 Sep 2023 13:14:51 +0000
Subject: [PATCH] Make local federated instances use comnpose file for build
 (#3968)

* Make local federated instances use comnpose file for build

* Remove commented out part of script
---
 docker/federation/docker-compose.yml         | 10 ++++++----
 docker/federation/start-local-instances.bash |  7 ++-----
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/docker/federation/docker-compose.yml b/docker/federation/docker-compose.yml
index 39ff952484..634a97449c 100644
--- a/docker/federation/docker-compose.yml
+++ b/docker/federation/docker-compose.yml
@@ -2,16 +2,18 @@ version: "3.7"
 
 x-ui-default: &ui-default
   init: true
-  image: dessalines/lemmy-ui:0.18.1
+  image: dessalines/lemmy-ui:0.18.4
   # assuming lemmy-ui is cloned besides lemmy directory
   # build:
-  #     context: ../../../lemmy-ui
-  #     dockerfile: dev.dockerfile
+  #   context: ../../../lemmy-ui
+  #   dockerfile: dev.dockerfile
   environment:
     - LEMMY_UI_HTTPS=false
 
 x-lemmy-default: &lemmy-default
-  image: lemmy-federation:latest
+  build:
+    context: ../..
+    dockerfile: docker/Dockerfile
   environment:
     - RUST_BACKTRACE=1
     - RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
diff --git a/docker/federation/start-local-instances.bash b/docker/federation/start-local-instances.bash
index b2350d3a89..716f4d45cc 100755
--- a/docker/federation/start-local-instances.bash
+++ b/docker/federation/start-local-instances.bash
@@ -1,14 +1,11 @@
 #!/bin/bash
 set -e
 
-sudo docker-compose down
-
-sudo docker build ../../ --file ../Dockerfile -t lemmy-federation:latest
+sudo docker compose down
 
 for Item in alpha beta gamma delta epsilon ; do
   sudo mkdir -p volumes/pictrs_$Item
   sudo chown -R 991:991 volumes/pictrs_$Item
 done
 
-#sudo docker-compose pull --ignore-pull-failures || true
-sudo docker-compose up
+sudo docker compose up