Docker
Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.
The fastest way to run PreviewProxy is with Docker. The official image is published to the GitHub Container Registry.
Quick Start
Section titled “Quick Start”docker run -d -p 8080:8080 ghcr.io/vigrise/previewproxy:latestPreviewProxy will be available at http://localhost:8080.
Test It
Section titled “Test It”Open the following URL in your browser to resize and convert a public image to WebP:
http://localhost:8080/400x300,webp/https://http.cat/200
The URL format is:
http://localhost:8080/<params>/<source-url>If the image is displayed in the browser, PreviewProxy is working.
Production Setup
Section titled “Production Setup”Docker Compose Example
Section titled “Docker Compose Example”A more complete setup using Docker Compose:
services: previewproxy: container_name: previewproxy image: ghcr.io/vigrise/previewproxy:latest restart: unless-stopped ports: - 8080:8080 environment: # Cache tuning PP_CACHE_MEMORY_MAX_MB: 512 PP_CACHE_DISK_MAX_MB: 4096 PP_CACHE_DIR: /cache # Local source # PP_LOCAL_ENABLED: true # PP_LOCAL_BASE_DIR: /local volumes: - ./previewproxy_cache:/cache # - /path/to/local/files:/local:ro logging: driver: "json-file" options: max-size: "10m"PreviewProxy will be available at http://localhost:8080.
For all available configuration options, see the Environment Variables reference. To enable S3 or local filesystem sources, see S3 Source and Local Filesystem Source.