Skip to content

Deployment Guide ​

Building ​

Backend ​

bash
cd backend
go build -o memesplora ./cmd/server

# Cross-compilation
GOOS=linux GOARCH=amd64 go build -o memesplora-linux-amd64 ./cmd/server
GOOS=windows GOARCH=amd64 go build -o memesplora-windows-amd64.exe ./cmd/server
GOOS=darwin GOARCH=amd64 go build -o memesplora-darwin-amd64 ./cmd/server

Frontend ​

bash
cd frontend
npm run build
# Output in dist/

Docker Deployment ​

dockerfile
FROM golang:1.22-alpine AS builder
WORKDIR /build
COPY backend/ .
RUN go build -o memesplora ./cmd/server

FROM alpine:3.19
COPY --from=builder /build/memesplora /usr/local/bin/
EXPOSE 5212 5213 5214
ENTRYPOINT ["memesplora"]
bash
docker build -t memesplora .
docker run -d -p 5212:5212 -p 5213:5213 -p 5214:5214 -e MEMESPLORA_MEMORY_SIZE=1073741824 memesplora

Nginx Reverse Proxy ​

nginx
server {
    listen 80;
    server_name memesplora.example.com;

    location / {
        proxy_pass http://127.0.0.1:5212;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }

    # S3 API
    location /s3/ {
        proxy_pass http://127.0.0.1:5213/;
    }

    # WebDAV
    location /webdav/ {
        proxy_pass http://127.0.0.1:5214/;
        client_max_body_size 0;
    }
}

Security Recommendations ​

  1. Change JWT Secret: Use a strong random string
  2. Enable HTTPS: Use Let's Encrypt or configure SSL
  3. Firewall: Restrict S3/WebDAV port access by IP
  4. Backup: Regularly backup the SQLite/PostgreSQL database

Apache License 2.0