]> Untitled Git - lemmy.git/commitdiff
Reorganizing docker compose files.
authorDessalines <tyhou13@gmx.com>
Fri, 16 Aug 2019 01:05:49 +0000 (18:05 -0700)
committerDessalines <tyhou13@gmx.com>
Fri, 16 Aug 2019 01:05:49 +0000 (18:05 -0700)
- Fixes #197

README.md
docker/dev/Dockerfile [moved from Dockerfile with 100% similarity]
docker/dev/docker-compose.yml [moved from docker-compose.yml with 72% similarity]
docker/docker_db_backup.sh [new file with mode: 0755]
docker/docker_update.sh [new file with mode: 0755]
docker/prod/docker-compose.yml [moved from docker/docker-compose.yml with 100% similarity]
docker_db_backup.sh [deleted file]
docker_update.sh [deleted file]

index b264b85362f3a452a559eece7f95d9a9d25ae9f1..a601ace0b19c73b8bb9730c2ca90a08c4d227327 100644 (file)
--- a/README.md
+++ b/README.md
@@ -70,7 +70,7 @@ Make sure you have both docker and docker-compose(>=`1.24.0`) installed.
 ```
 mkdir lemmy/
 cd lemmy/
-wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/docker-compose.yml
+wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/prod/docker-compose.yml
 docker-compose up -d
 ```
 
@@ -98,7 +98,7 @@ location / {
 
 ```
 git clone https://github.com/dessalines/lemmy
-cd lemmy
+cd lemmy/docker
 ./docker_update.sh # This pulls the newest version, builds and runs it
 ```
 
similarity index 100%
rename from Dockerfile
rename to docker/dev/Dockerfile
similarity index 72%
rename from docker-compose.yml
rename to docker/dev/docker-compose.yml
index 8607d546c0d47df13227d111e54533f91315ee6d..b4daff61c5f395ce1baedac561d783497a5f1d9d 100644 (file)
@@ -1,7 +1,7 @@
 version: '2.4'
 
 services:
-  db:
+  lemmy_db:
     image: postgres:12-alpine
     restart: always
     environment:
@@ -9,7 +9,7 @@ services:
       POSTGRES_PASSWORD: rrr
       POSTGRES_DB: rrr
     volumes:
-      - db:/var/lib/postgresql/data
+      - lemmy_db:/var/lib/postgresql/data
     healthcheck:
       test: ["CMD-SHELL", "pg_isready -U rrr"]
       interval: 5s
@@ -17,17 +17,18 @@ services:
       retries: 20
   lemmy:
     build: 
-      context: .
+      context: ../../
+      dockerfile: docker/dev/Dockerfile
     ports:
       - "8536:8536"
     environment:
       LEMMY_FRONT_END_DIR: /app/dist
-      DATABASE_URL: postgres://rrr:rrr@db:5432/rrr
+      DATABASE_URL: postgres://rrr:rrr@lemmy_db:5432/rrr
       JWT_SECRET: changeme
       HOSTNAME: rrr
     restart: always
     depends_on: 
-      db: 
+      lemmy_db: 
         condition: service_healthy 
 volumes:
-  db:
+  lemmy_db:
diff --git a/docker/docker_db_backup.sh b/docker/docker_db_backup.sh
new file mode 100755 (executable)
index 0000000..d42826e
--- /dev/null
@@ -0,0 +1 @@
+docker exec -it dev_lemmy_db_1 pg_dumpall -c -U rrr > dump_`date +%Y-%m-%d"_"%H_%M_%S`.sql
diff --git a/docker/docker_update.sh b/docker/docker_update.sh
new file mode 100755 (executable)
index 0000000..0891943
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -e
+
+git pull
+docker-compose -f dev/docker-compose.yml up -d --no-deps --build
diff --git a/docker_db_backup.sh b/docker_db_backup.sh
deleted file mode 100755 (executable)
index e361da1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-docker exec -it lemmy_db_1 pg_dumpall -c -U rrr > dump_`date +%Y-%m-%d"_"%H_%M_%S`.sql
diff --git a/docker_update.sh b/docker_update.sh
deleted file mode 100755 (executable)
index 4a52b52..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-set -e
-
-git pull
-docker-compose up -d --no-deps --build