Advertisement
Guest User

Untitled

a guest
Jul 8th, 2023
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.16 KB | None | 0 0
  1. version: "3.7"
  2.  
  3. # 1. Have this docker compose file along with the lemmy.hjson and nginx.conf in the same directory
  4. #  a. https://raw.githubusercontent.com/LemmyNet/lemmy/main/docker/nginx.conf
  5. #  b. https://raw.githubusercontent.com/LemmyNet/lemmy/main/docker/lemmy.hjson
  6. # 2. In the lemmy.hjson file edit ((hostname: "localhost")) to your actual host (eg. hostname: "lemmy.example.com")
  7. #  a. You can also change the admin_username (the admin_password and site_name can be changed later)
  8. # 3. In the same directory create a folder called 'pictrs' and 'postgres'
  9. # 4. Edit ownership of pictrs folder user:group of 991:991. CLI example: chown 991:991 pictrs
  10. # 5. In this directory from CLI you can now run: docker-compose up -d
  11. # 6. Lemmy should now be up on http://(ip_address):1236
  12. #  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).
  13. # 7. This docker compose setup is now ready to be put behind a reverse proxy
  14.  
  15. services:
  16.   proxy:
  17.     image: nginx:1.25.1
  18.     ports:
  19.      - "1236:1236"
  20.       - "8536:8536"
  21.     volumes:
  22.      - ./nginx.conf:/etc/nginx/nginx.conf:ro,Z
  23.     restart: unless-stopped
  24.     depends_on:
  25.      - pictrs
  26.       - lemmy-ui
  27.  
  28.   lemmy:
  29.     image: dessalines/lemmy:0.18.1
  30.     hostname: lemmy
  31.     restart: unless-stopped
  32.     environment:
  33.      - 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"
  34.       - RUST_BACKTRACE=full
  35.     volumes:
  36.      - ./lemmy.hjson:/config/config.hjson:Z
  37.     depends_on:
  38.      - postgres
  39.       - pictrs
  40.  
  41.   lemmy-ui:
  42.     image: dessalines/lemmy-ui:0.18.1
  43.     environment:
  44.      - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536
  45.       # Port 1236 is the one from nginx
  46.       - LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:1236
  47.       - LEMMY_UI_HTTPS=false
  48.       - LEMMY_UI_DEBUG=true
  49.     depends_on:
  50.      - lemmy
  51.     restart: unless-stopped
  52.  
  53.   pictrs:
  54.     image: asonix/pictrs:0.4.0-rc.14
  55.     hostname: pictrs
  56.     environment:
  57.      - PICTRS__API_KEY=API_KEY
  58.       - RUST_LOG=debug
  59.       - RUST_BACKTRACE=full
  60.       - PICTRS__MEDIA__VIDEO_CODEC=vp9
  61.       - PICTRS__MEDIA__GIF__MAX_WIDTH=256
  62.       - PICTRS__MEDIA__GIF__MAX_HEIGHT=256
  63.       - PICTRS__MEDIA__GIF__MAX_AREA=65536
  64.       - PICTRS__MEDIA__GIF__MAX_FRAME_COUNT=400
  65.     user: 991:991
  66.     volumes:
  67.      - ./pictrs:/mnt
  68.     restart: unless-stopped
  69.  
  70.   postgres:
  71.     image: postgres:15.3
  72.     hostname: postgres
  73.     command:
  74.      [
  75.         "postgres",
  76.         "-c",
  77.         "session_preload_libraries=auto_explain",
  78.         "-c",
  79.         "auto_explain.log_min_duration=5ms",
  80.         "-c",
  81.         "auto_explain.log_analyze=true",
  82.         "-c",
  83.         "track_activity_query_size=1048576",
  84.       ]
  85.     environment:
  86.      - POSTGRES_USER=lemmy
  87.       - POSTGRES_PASSWORD=password
  88.       - POSTGRES_DB=lemmy
  89.     volumes:
  90.      - ./postgres:/var/lib/postgresql/data
  91.     restart: unless-stopped
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement