Initial WallMuse project

This commit is contained in:
fenglee
2026-05-09 09:12:41 +00:00
commit 3ea7d29827
91 changed files with 13136 additions and 0 deletions

78
infra/docker-compose.yml Executable file
View File

@@ -0,0 +1,78 @@
name: wallmuse
services:
postgres:
image: postgres:17-alpine
container_name: wallmuse-postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-wallmuse}
POSTGRES_USER: ${POSTGRES_USER:-wallmuse}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-wallmuse_dev_password}
ports:
- "5432:5432"
volumes:
- wallmuse-postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-wallmuse} -d ${POSTGRES_DB:-wallmuse}"]
interval: 10s
timeout: 5s
retries: 10
redis:
image: redis:8-alpine
container_name: wallmuse-redis
restart: unless-stopped
command: ["redis-server", "--appendonly", "yes"]
ports:
- "6379:6379"
volumes:
- wallmuse-redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 10
minio:
image: minio/minio:RELEASE.2025-04-22T22-12-26Z
container_name: wallmuse-minio
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-wallmuse}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-wallmuse_minio_password}
ports:
- "9000:9000"
- "9001:9001"
volumes:
- wallmuse-minio-data:/data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 10s
timeout: 5s
retries: 10
minio-init:
image: minio/mc:RELEASE.2025-04-16T18-13-26Z
container_name: wallmuse-minio-init
depends_on:
minio:
condition: service_healthy
entrypoint: ["/bin/sh", "/scripts/create-buckets.sh"]
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-wallmuse}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-wallmuse_minio_password}
S3_BUCKET_ORIGINALS: ${S3_BUCKET_ORIGINALS:-wallpaper-originals}
S3_BUCKET_PREVIEWS: ${S3_BUCKET_PREVIEWS:-wallpaper-previews}
S3_BUCKET_DOWNLOADS: ${S3_BUCKET_DOWNLOADS:-wallpaper-downloads}
S3_BUCKET_REFERENCES: ${S3_BUCKET_REFERENCES:-wallpaper-references}
S3_BUCKET_TEMP: ${S3_BUCKET_TEMP:-wallpaper-temp}
volumes:
- ./minio/create-buckets.sh:/scripts/create-buckets.sh:ro
restart: "no"
volumes:
wallmuse-postgres-data:
wallmuse-redis-data:
wallmuse-minio-data:

16
infra/minio/create-buckets.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/sh
set -eu
mc alias set wallmuse http://minio:9000 "$MINIO_ROOT_USER" "$MINIO_ROOT_PASSWORD"
for bucket in \
"$S3_BUCKET_ORIGINALS" \
"$S3_BUCKET_PREVIEWS" \
"$S3_BUCKET_DOWNLOADS" \
"$S3_BUCKET_REFERENCES" \
"$S3_BUCKET_TEMP"
do
mc mb --ignore-existing "wallmuse/$bucket"
done
mc ls wallmuse

28
infra/nginx/wallmuse.dev.conf Executable file
View File

@@ -0,0 +1,28 @@
server {
listen 80;
server_name wallmuse.local;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /admin/ {
proxy_pass http://127.0.0.1:3100/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /api/ {
proxy_pass http://127.0.0.1:4000/api/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

9
infra/postgres/README.md Executable file
View File

@@ -0,0 +1,9 @@
# PostgreSQL
The development PostgreSQL instance is managed by `infra/docker-compose.yml`.
Default connection:
```txt
postgresql://wallmuse:wallmuse_dev_password@localhost:5432/wallmuse
```