aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-10-08 03:43:08 +0300
committerAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-10-08 03:50:53 +0300
commite849e705c30cceec3cf7336a21bed96c8a911e90 (patch)
tree93f559bcd4cf3e53193930d112e564a2b7462ac8 /contrib
parent3ee654f6fb3cdf119630bfba8066c96ec26428c3 (diff)
Добавил рейтинг
Добавил страницу топа Добавил rss/xml/json feed
Diffstat (limited to 'contrib')
-rw-r--r--contrib/dev/docker-compose.yml20
-rw-r--r--contrib/prod/.env3
-rw-r--r--contrib/prod/docker-compose.yml37
3 files changed, 60 insertions, 0 deletions
diff --git a/contrib/dev/docker-compose.yml b/contrib/dev/docker-compose.yml
new file mode 100644
index 0000000..92b3871
--- /dev/null
+++ b/contrib/dev/docker-compose.yml
@@ -0,0 +1,20 @@
+version: '3.9'
+
+services:
+
+ db:
+ image: postgres
+ restart: always
+ shm_size: 128mb
+ environment:
+ POSTGRES_DB: shorg
+ POSTGRES_USER: shorg
+ POSTGRES_PASSWORD: shorg
+ ports:
+ - 5432:5432
+
+ adminer:
+ image: adminer
+ restart: always
+ ports:
+ - 8090:8080
diff --git a/contrib/prod/.env b/contrib/prod/.env
new file mode 100644
index 0000000..4f0dd77
--- /dev/null
+++ b/contrib/prod/.env
@@ -0,0 +1,3 @@
+POSTGRES_DB=shorg
+POSTGRES_USER=shorg
+POSTGRES_PASSWORD=shorg \ No newline at end of file
diff --git a/contrib/prod/docker-compose.yml b/contrib/prod/docker-compose.yml
new file mode 100644
index 0000000..167301b
--- /dev/null
+++ b/contrib/prod/docker-compose.yml
@@ -0,0 +1,37 @@
+version: '3.3'
+
+services:
+ db:
+ image: postgres
+ shm_size: 128mb
+ env_file: .env
+ volumes:
+ - data:/var/lib/postgresql/data
+ healthcheck:
+ test: [ "CMD-SHELL", "pg_isready -U shorg -d shorg" ]
+ interval: 30s
+ timeout: 30s
+ retries: 5
+ restart: unless-stopped
+ app:
+ image: gitrepo.ru/neonxp/shorg:latest
+ volumes:
+ - config:/config
+ command: serve -config=/config/prod.yaml
+ depends_on:
+ db:
+ condition: service_healthy
+ ports:
+ - 8093:8000
+ restart: unless-stopped
+ migration:
+ image: gitrepo.ru/neonxp/shorg:latest
+ volumes:
+ - config:/config
+ command: db migrate -config=/config/prod.yaml
+ depends_on:
+ db:
+ condition: service_healthy
+volumes:
+ data:
+ config: