Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: "3.7"
- # 1. Have this docker compose file along with the lemmy.hjson and nginx.conf in the same directory
- # a. https://raw.githubusercontent.com/LemmyNet/lemmy/main/docker/nginx.conf
- # b. https://raw.githubusercontent.com/LemmyNet/lemmy/main/docker/lemmy.hjson
- # 2. In the lemmy.hjson file edit ((hostname: "localhost")) to your actual host (eg. hostname: "lemmy.example.com")
- # a. You can also change the admin_username (the admin_password and site_name can be changed later)
- # 3. In the same directory create a folder called 'pictrs' and 'postgres'
- # 4. Edit ownership of pictrs folder user:group of 991:991. CLI example: chown 991:991 pictrs
- # 5. In this directory from CLI you can now run: docker-compose up -d
- # 6. Lemmy should now be up on http://(ip_address):1236
- # a. If it is on a VPS you might need to temporarily open up firewall to access it publically for testing (CLI example: ufw allow 1236). Make sure you close it afterwards (CLI example: ufw disable 1236).
- # 7. This docker compose setup is now ready to be put behind a reverse proxy
- services:
- proxy:
- image: nginx:1.25.1
- ports:
- - "1236:1236"
- - "8536:8536"
- volumes:
- - ./nginx.conf:/etc/nginx/nginx.conf:ro,Z
- restart: unless-stopped
- depends_on:
- - pictrs
- - lemmy-ui
- lemmy:
- image: dessalines/lemmy:0.18.1
- hostname: lemmy
- restart: unless-stopped
- environment:
- - RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
- - RUST_BACKTRACE=full
- volumes:
- - ./lemmy.hjson:/config/config.hjson:Z
- depends_on:
- - postgres
- - pictrs
- lemmy-ui:
- image: dessalines/lemmy-ui:0.18.1
- environment:
- - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536
- # Port 1236 is the one from nginx
- - LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:1236
- - LEMMY_UI_HTTPS=false
- - LEMMY_UI_DEBUG=true
- depends_on:
- - lemmy
- restart: unless-stopped
- pictrs:
- image: asonix/pictrs:0.4.0-rc.14
- hostname: pictrs
- environment:
- - PICTRS__API_KEY=API_KEY
- - RUST_LOG=debug
- - RUST_BACKTRACE=full
- - PICTRS__MEDIA__VIDEO_CODEC=vp9
- - PICTRS__MEDIA__GIF__MAX_WIDTH=256
- - PICTRS__MEDIA__GIF__MAX_HEIGHT=256
- - PICTRS__MEDIA__GIF__MAX_AREA=65536
- - PICTRS__MEDIA__GIF__MAX_FRAME_COUNT=400
- user: 991:991
- volumes:
- - ./pictrs:/mnt
- restart: unless-stopped
- postgres:
- image: postgres:15.3
- hostname: postgres
- command:
- [
- "postgres",
- "-c",
- "session_preload_libraries=auto_explain",
- "-c",
- "auto_explain.log_min_duration=5ms",
- "-c",
- "auto_explain.log_analyze=true",
- "-c",
- "track_activity_query_size=1048576",
- ]
- environment:
- - POSTGRES_USER=lemmy
- - POSTGRES_PASSWORD=password
- - POSTGRES_DB=lemmy
- volumes:
- - ./postgres:/var/lib/postgresql/data
- restart: unless-stopped
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement