]> Untitled Git - lemmy.git/blob - docker/dev/docker-compose.yml
Fixing missing forms, incorrect user discussion_languages (#2580)
[lemmy.git] / docker / dev / docker-compose.yml
1 version: "3.3"
2
3 networks:
4   # communication to web and clients
5   lemmyexternalproxy:
6   # communication between lemmy services
7   lemmyinternal:
8     driver: bridge
9     internal: true
10
11 services:
12   proxy:
13     image: nginx:1-alpine
14     networks:
15       - lemmyinternal
16       - lemmyexternalproxy
17     ports:
18     # actual and only port facing any connection from outside 
19       - "1236:1236"
20       - "8536:8536"
21     volumes:
22       - ./nginx.conf:/etc/nginx/nginx.conf:ro
23     restart: always
24     depends_on:
25       - pictrs
26       - lemmy-ui
27
28   lemmy:
29     # image: dessalines/lemmy:dev
30     # use this to build your local lemmy server image for development
31     # run docker compose up --build
32     build: 
33       context: ../..
34       dockerfile: docker/dev/Dockerfile
35     # this hostname is used in nginx reverse proxy and also for lemmy ui to connect to the backend, do not change
36     hostname: lemmy
37     networks:
38       - lemmyinternal
39     restart: always
40     environment:
41       - 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"
42       - RUST_BACKTRACE=full
43     volumes:
44       - ./lemmy.hjson:/config/config.hjson
45     depends_on:
46       - postgres
47       - pictrs
48
49   lemmy-ui:
50     image: dessalines/lemmy-ui:dev
51     # use this to build your local lemmy ui image for development
52     # run docker compose up --build
53     # assuming lemmy-ui is cloned besides lemmy directory
54     # build: 
55     #  context: ../../../lemmy-ui
56     #  dockerfile: dev.dockerfile
57     networks:
58       - lemmyinternal
59     environment:
60       # this needs to match the hostname defined in the lemmy service
61       - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536
62       # set the outside hostname here
63       - LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:1236
64       - LEMMY_HTTPS=false
65       - LEMMY_UI_DEBUG=true
66     depends_on:
67       - lemmy
68     restart: always
69
70   pictrs:
71     image: asonix/pictrs:0.3.1
72     # this needs to match the pictrs url in lemmy.hjson
73     hostname: pictrs
74     # we can set options to pictrs like this, here we set max. image size and forced format for conversion
75     # entrypoint: /sbin/tini -- /usr/local/bin/pict-rs -p /mnt -m 4 --image-format webp
76     networks:
77       - lemmyinternal
78     environment:
79       - PICTRS_OPENTELEMETRY_URL=http://otel:4137
80       - PICTRS__API_KEY=API_KEY
81       - RUST_LOG=debug
82       - RUST_BACKTRACE=full
83     user: 991:991
84     volumes:
85       - ./volumes/pictrs:/mnt
86     restart: always
87
88   postgres:
89     image: postgres:14-alpine
90     # this needs to match the database host in lemmy.hson
91     hostname: postgres
92     command: ["postgres", "-c", "session_preload_libraries=auto_explain", "-c", "auto_explain.log_min_duration=5ms", "-c", "auto_explain.log_analyze=true"]
93     networks:
94       - lemmyinternal
95     # adding the external facing network to allow direct db access for devs
96       - lemmyexternalproxy
97     ports:
98     # use a different port so it doesnt conflict with potential postgres db running on the host
99       - "5433:5432"
100     environment:
101       - POSTGRES_USER=lemmy
102       - POSTGRES_PASSWORD=password
103       - POSTGRES_DB=lemmy
104     volumes:
105       - ./volumes/postgres:/var/lib/postgresql/data
106     restart: always
107
108   otel:
109     image: otel/opentelemetry-collector:latest
110     command: --config otel-local-config.yaml
111     networks:
112       - lemmyinternal
113       - lemmyexternalproxy
114     ports:
115       - "4317:4317"
116     volumes:
117       - type: bind
118         source: ./otel.yml
119         target: /otel-local-config.yaml
120     restart: unless-stopped
121     depends_on:
122       - jaeger
123   
124   jaeger:
125     image: jaegertracing/all-in-one:1
126     networks:
127       - lemmyinternal
128       - lemmyexternalproxy
129     ports:
130       - "14250:14250"
131       # To view traces, visit http://localhost:16686
132       - "16686:16686"
133     restart: unless-stopped