Reformat Docker Compose and add external network
Standardize indentation to a consistent hierarchy and declare the homelab network as an external resource.
This commit is contained in:
@@ -1,55 +1,58 @@
|
|||||||
services:
|
services:
|
||||||
# PostgreSQL Database
|
# PostgreSQL Database
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
container_name: memos-postgres
|
container_name: memos-postgres
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: memos
|
POSTGRES_DB: memos
|
||||||
POSTGRES_USER: memos
|
POSTGRES_USER: memos
|
||||||
POSTGRES_PASSWORD: zcA3LEfW
|
POSTGRES_PASSWORD: zcA3LEfW
|
||||||
PGDATA: /var/lib/postgresql/data/pgdata
|
PGDATA: /var/lib/postgresql/data/pgdata
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U memos -d memos"]
|
test: ["CMD-SHELL", "pg_isready -U memos -d memos"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
networks:
|
networks:
|
||||||
- homelab
|
- homelab
|
||||||
|
|
||||||
# Memos Application
|
# Memos Application
|
||||||
memos:
|
memos:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: memos-app
|
container_name: memos-app
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "8081:8081"
|
- "8081:8081"
|
||||||
environment:
|
environment:
|
||||||
# Database configuration
|
# Database configuration
|
||||||
MEMOS_DRIVER: postgres
|
MEMOS_DRIVER: postgres
|
||||||
MEMOS_DSN: "postgres://memos:zcA3LEfW@postgres:5432/memos?sslmode=disable"
|
MEMOS_DSN: "postgres://memos:zcA3LEfW@postgres:5432/memos?sslmode=disable"
|
||||||
|
|
||||||
# Application configuration
|
# Application configuration
|
||||||
MEMOS_MODE: prod
|
MEMOS_MODE: prod
|
||||||
MEMOS_PORT: 8081
|
MEMOS_PORT: 8081
|
||||||
MEMOS_DATA: /var/opt/memos
|
MEMOS_DATA: /var/opt/memos
|
||||||
|
|
||||||
# Optional: Set your instance URL
|
# Optional: Set your instance URL
|
||||||
# MEMOS_INSTANCE_URL: "https://your-domain.com"
|
# MEMOS_INSTANCE_URL: "https://your-domain.com"
|
||||||
volumes:
|
volumes:
|
||||||
- memos_data:/var/opt/memos
|
- memos_data:/var/opt/memos
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
networks:
|
networks:
|
||||||
- homelab
|
- homelab
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
driver: local
|
driver: local
|
||||||
memos_data:
|
memos_data:
|
||||||
driver: local
|
driver: local
|
||||||
|
networks:
|
||||||
|
homelab:
|
||||||
|
external: true
|
||||||
|
|||||||
Reference in New Issue
Block a user