about summary refs log tree commit diff
path: root/in-a-box/docker-compose.yml
diff options
context:
space:
mode:
Diffstat (limited to 'in-a-box/docker-compose.yml')
-rw-r--r--in-a-box/docker-compose.yml91
1 files changed, 91 insertions, 0 deletions
diff --git a/in-a-box/docker-compose.yml b/in-a-box/docker-compose.yml
new file mode 100644
index 0000000..ff71cea
--- /dev/null
+++ b/in-a-box/docker-compose.yml
@@ -0,0 +1,91 @@
+version: '2.1'
+services:
+
+  nginx:
+    restart: always
+    image: nginx:mainline
+    volumes:
+      - ./.docker/nginx/nginx.conf:/etc/nginx/conf.d/template.ro:ro
+#     Replace the /path/to/letsencrypt/stuff.pem with wherever the corresponding files are:
+      - /path/to/letsencrypt/fullchain.pem:/etc/ssl/fullchain.pem:ro
+      - /path/to/letsencrypt/privkey.pem:/etc/ssl/privkey.pem:ro
+      - /path/to/letsencrypt/cert.pem:/etc/ssl/cert.pem:ro
+      - ./public:/var/www/html:ro
+      - /etc/localtime:/etc/localtime:ro
+    ports:
+      - "80:80"
+      - "443:443"
+    environment:
+#       Replace example.com with your webserver:
+      - NGINX_HOST=example.com
+    networks:
+      - external_network
+    command: sh -c "envsubst \"`env | awk -F = '{printf \" $$%s, $$1}'`\" < /etc/nginx/conf.d/template.ro > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
+
+  mstdb:
+    restart: always
+    image: postgres:10.3-alpine
+    networks:
+      - mstdb_network
+    volumes:
+      - /etc/localtime:/etc/localtime:ro
+      - ./.docker/mastodon/db:/var/lib/postgresql/data
+
+  mstredis:
+    restart: always
+    image: redis:alpine
+    networks:
+      - mstredis_network
+    volumes:
+      - /etc/localtime:/etc/localtime:ro
+      - ./.docker/mastodon/redis:/data
+
+#  mstes:
+#    restart: always
+#    image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.3
+#    environment:
+#      - bootstrap.memory_lock=true
+#      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
+#    ulimits:
+#      memlock:
+#        soft: -1
+#        hard: -1
+#    networks:
+#      - mstes_network
+#    volumes:
+#      - /etc/localtime:/etc/localtime:ro
+#      - /etc/timezone:/etc/timezone:ro
+#      - ./.docker/mastodon/es:/usr/share/elasticsearch/data
+
+  mstweb:
+    image: pluralcafe/mastodon:stable
+    restart: always
+# Get .env.production from https://raw.githubusercontent.com/tootsuite/mastodon/master/.env.production.sample
+    env_file: ./.docker/mastodon/.env.production
+    networks:
+      - external_network
+      - mstdb_network
+      - mstredis_network
+    depends_on:
+      - mstdb
+      - mstredis
+#      - mstes
+    volumes:
+      - ./public/system:/mastodon/public/system
+      - /etc/localtime:/etc/localtime:ro
+
+networks:
+  external_network:
+# Uncomment the below for IPv6 support and fill in the last subnet
+# with the IPv6 subnet your hosting provider gave you
+#    driver: bridge
+#    enable_ipv6: true
+#    ipam:
+#      driver: default
+#      config:
+#        - subnet: 172.18.0.0/16
+#        - subnet: 2600:1111:2222:3333::/64
+  mstdb_network:
+    internal: true
+  mstredis_network:
+    internal: true