From 629d95f6c9e034764ac49445e5687b008b98487f Mon Sep 17 00:00:00 2001 From: Nevo David Date: Wed, 30 Jul 2025 16:49:32 +0700 Subject: [PATCH] feat: serve uploads --- docker-compose.yaml | 87 +++++++++++++++++++++++++++++++++++++++++++ var/docker/nginx.conf | 4 ++ 2 files changed, 91 insertions(+) create mode 100644 docker-compose.yaml diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 00000000..52330901 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,87 @@ +services: + postiz: + build: + context: . + dockerfile: Dockerfile.dev + container_name: postiz + restart: always + environment: + # You must change these. Replace `postiz.your-server.com` with your DNS name - this needs to be exactly the URL you're accessing Postiz on. + MAIN_URL: "http://localhost:5450" + FRONTEND_URL: "http://localhost:5450" + NEXT_PUBLIC_BACKEND_URL: "http://localhost:5450/api" + JWT_SECRET: "random string that is unique to every install - just type random characters here!" + + # These defaults are probably fine, but if you change your user/password, update it in the + # postiz-postgres or postiz-redis services below. + DATABASE_URL: "postgresql://postiz-user:postiz-password@postiz-postgres:5432/postiz-db-local" + REDIS_URL: "redis://postiz-redis:6379" + BACKEND_INTERNAL_URL: "http://localhost:3000" + IS_GENERAL: "true" # Required for self-hosting. + DISABLE_REGISTRATION: "false" # Only allow single registration, then disable signup + # The container images are pre-configured to use /uploads for file storage. + # You probably should not change this unless you have a really good reason! + STORAGE_PROVIDER: "local" + UPLOAD_DIRECTORY: "/uploads" + NEXT_PUBLIC_UPLOAD_DIRECTORY: "/uploads" + volumes: + - postiz-config:/config/ + - postiz-uploads:/uploads/ + ports: + - 5000:5000 + networks: + - postiz-network + depends_on: + postiz-postgres: + condition: service_healthy + postiz-redis: + condition: service_healthy + + postiz-postgres: + image: postgres:17-alpine + container_name: postiz-postgres + restart: always + environment: + POSTGRES_PASSWORD: postiz-password + POSTGRES_USER: postiz-user + POSTGRES_DB: postiz-db-local + volumes: + - postgres-volume:/var/lib/postgresql/data + networks: + - postiz-network + healthcheck: + test: pg_isready -U postiz-user -d postiz-db-local + interval: 10s + timeout: 3s + retries: 3 + postiz-redis: + image: redis:7.2 + container_name: postiz-redis + restart: always + healthcheck: + test: redis-cli ping + interval: 10s + timeout: 3s + retries: 3 + volumes: + - postiz-redis-data:/data + networks: + - postiz-network + + +volumes: + postgres-volume: + external: false + + postiz-redis-data: + external: false + + postiz-config: + external: false + + postiz-uploads: + external: false + +networks: + postiz-network: + external: false \ No newline at end of file diff --git a/var/docker/nginx.conf b/var/docker/nginx.conf index d783678a..346ef62b 100644 --- a/var/docker/nginx.conf +++ b/var/docker/nginx.conf @@ -33,6 +33,10 @@ http { proxy_set_header Accept-Language $http_accept_language; } + location /uploads/ { + alias /uploads/; + } + location / { proxy_pass http://localhost:4200/; proxy_http_version 1.1;