Add a production-ready compose and enhance the development one

This commit is contained in:
TheFrenchGhosty 2021-11-04 16:05:31 +01:00
parent 692d6164b3
commit eb8e1f394b
2 changed files with 67 additions and 14 deletions

View File

@ -48,7 +48,48 @@ See ```CHANGELOG.md```
## Installation ## Installation
### Docker-compose method ### Docker-compose method (production)
```console
version: "3.8"
services:
teddit:
container_name: teddit
image: teddit/teddit:latest
environment:
- DOMAIN=teddit.net
- USE_HELMET=true
- USE_HELMET_HSTS=true
- TRUST_PROXY=true
- REDIS_HOST=teddit-redis
ports:
- "127.0.0.1:8080:8080"
networks:
- teddit_net
healthcheck:
test: ["CMD", "wget" ,"--no-verbose", "--tries=1", "--spider", "http://localhost:8080/about"]
interval: 1m
timeout: 3s
depends_on:
- teddit-redis
teddit-redis:
container_name: teddit-redis
image: redis:6.2.5-alpine
command: redis-server
environment:
- REDIS_REPLICATION_MODE=master
networks:
- teddit_net
networks:
teddit_net:
```
### Docker-compose method (development)
```console ```console
git clone https://codeberg.org/teddit/teddit git clone https://codeberg.org/teddit/teddit

View File

@ -1,21 +1,23 @@
version: "3.8" version: "3.8"
services: services:
redis:
image: redis:6.2.5-alpine teddit:
command: redis-server container_name: teddit
environment:
- REDIS_REPLICATION_MODE=master
ports:
- "6379:6379"
networks:
- teddit_net
web:
build: . build: .
environment: environment:
- REDIS_HOST=redis - DOMAIN=teddit.pussthecat.org
- THEME=dark
- USE_HELMET=true
- USE_HELMET_HSTS=true
- TRUST_PROXY=true
- NSFW_ENABLED=false
- POST_COMMENTS_SORT=top
- CACHE_CONTROL=true
- CACHE_MAX_SIZE=10000
- REDIS_HOST=teddit-redis
ports: ports:
- 8080:8080 - "8080:8080"
networks: networks:
- teddit_net - teddit_net
healthcheck: healthcheck:
@ -23,6 +25,16 @@ services:
interval: 1m interval: 1m
timeout: 3s timeout: 3s
depends_on: depends_on:
- redis - teddit-redis
teddit-redis:
container_name: teddit-redis
image: redis:6.2.5-alpine
command: redis-server
environment:
- REDIS_REPLICATION_MODE=master
networks:
- teddit_net
networks: networks:
teddit_net: teddit_net: