-
Notifications
You must be signed in to change notification settings - Fork 5
/
example-docker-compose.yml
57 lines (53 loc) · 1.69 KB
/
example-docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
version: '2'
services:
myip:
container_name: myip
restart: always
# build: .
image: privex/myip
ports:
- "127.0.0.1:5252:5252"
volumes:
- "/usr/share/GeoIP:/usr/share/GeoIP"
depends_on:
- redis
environment:
REDIS_HOST: redis
CACHE_ADAPTER: redis
env_file: ./.env
redis:
restart: always
image: redis:latest
hostname: redis
container_name: myip-redis
env_file: ./dkr/config/redis/redis.env
volumes:
- "./dkr/data/redis:/data"
ports:
# To avoid a potential conflict with a host-installed Redis,
# we expose the port onto the alternative loopback IP 127.0.0.2
- "127.0.0.2:6379:6379"
############################################
# Due to Docker networking generally using some form of NAT between clients and Docker containers,
# it's somewhat pointless to run a webserver for this app in Docker, since it will be unable to
# detect their IP, resulting in the app simply receiving the Docker network gateway IP, instead of
# the actual client's IP.
#
# Unless your server is behind an external reverse proxy such as Cloudflare, which forwards the client's IP
# in a header which you're able to process / pass to the application, then we strongly recommend that you run
# a webserver/reverse proxy on the host (actual bare server), not in docker.
#####
#
# caddy:
# restart: always
# image: caddy:latest
# hostname: caddy
# container_name: myip-caddy
# volumes:
# - "./dkr/config/caddy/Caddyfile:/etc/caddy/Caddyfile"
# - "./dkr/data/caddy/data:/data"
# - "./dkr/data/caddy/config:/config"
# env_file: ./dkr/config/caddy/caddy.env
# ports:
# - "443:443"
# - "80:80"