Use my docker-compose file with latest
This commit is contained in:
parent
66075683e4
commit
f185b13a3a
3 changed files with 135 additions and 7 deletions
|
@ -59,6 +59,7 @@ redis_port: 6379
|
||||||
db_host: /var/run/postgresql
|
db_host: /var/run/postgresql
|
||||||
self_signed_cert_location: /etc/ssl/certs
|
self_signed_cert_location: /etc/ssl/certs
|
||||||
self_signed_key_location: /etc/ssl/private
|
self_signed_key_location: /etc/ssl/private
|
||||||
|
mastodon_composer_folder: /etc/mastodon_docker_compose
|
||||||
|
|
||||||
es_enabled: 'false'
|
es_enabled: 'false'
|
||||||
es_host: localhost
|
es_host: localhost
|
||||||
|
|
117
files/docker-compose.yml
Normal file
117
files/docker-compose.yml
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
|
||||||
|
db:
|
||||||
|
restart: always
|
||||||
|
image: postgres:latest # 14-alpine
|
||||||
|
shm_size: 256mb
|
||||||
|
networks:
|
||||||
|
- internal_network
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "pg_isready", "-U", "postgres"]
|
||||||
|
volumes:
|
||||||
|
- ./postgres14:/var/lib/postgresql/data
|
||||||
|
environment:
|
||||||
|
- "POSTGRES_HOST_AUTH_METHOD=trust"
|
||||||
|
|
||||||
|
redis:
|
||||||
|
restart: always
|
||||||
|
image: redis:latest # 6-alpine
|
||||||
|
networks:
|
||||||
|
- internal_network
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
volumes:
|
||||||
|
- ./redis:/data
|
||||||
|
|
||||||
|
# es:
|
||||||
|
# restart: always
|
||||||
|
# image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
|
||||||
|
# environment:
|
||||||
|
# - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
|
||||||
|
# - "cluster.name=es-mastodon"
|
||||||
|
# - "discovery.type=single-node"
|
||||||
|
# - "bootstrap.memory_lock=true"
|
||||||
|
# networks:
|
||||||
|
# - internal_network
|
||||||
|
# healthcheck:
|
||||||
|
# test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"]
|
||||||
|
# volumes:
|
||||||
|
# - ./elasticsearch:/usr/share/elasticsearch/data
|
||||||
|
# ulimits:
|
||||||
|
# memlock:
|
||||||
|
# soft: -1
|
||||||
|
# hard: -1
|
||||||
|
|
||||||
|
web:
|
||||||
|
build: .
|
||||||
|
image: tootsuite/mastodon
|
||||||
|
restart: always
|
||||||
|
env_file: .env.production
|
||||||
|
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
|
||||||
|
networks:
|
||||||
|
- external_network
|
||||||
|
- internal_network
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "wget -q --spider --proxy=off localhost:3000/health || exit 1"]
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:3000:3000"
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
- redis
|
||||||
|
# - es
|
||||||
|
volumes:
|
||||||
|
- ./public/system:/mastodon/public/system
|
||||||
|
|
||||||
|
streaming:
|
||||||
|
build: .
|
||||||
|
image: tootsuite/mastodon
|
||||||
|
restart: always
|
||||||
|
env_file: .env.production
|
||||||
|
command: node ./streaming
|
||||||
|
networks:
|
||||||
|
- external_network
|
||||||
|
- internal_network
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1"]
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:4000:4000"
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
- redis
|
||||||
|
|
||||||
|
sidekiq:
|
||||||
|
build: .
|
||||||
|
image: tootsuite/mastodon
|
||||||
|
restart: always
|
||||||
|
env_file: .env.production
|
||||||
|
command: bundle exec sidekiq
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
- redis
|
||||||
|
networks:
|
||||||
|
- external_network
|
||||||
|
- internal_network
|
||||||
|
volumes:
|
||||||
|
- ./public/system:/mastodon/public/system
|
||||||
|
## Uncomment to enable federation with tor instances along with adding the following ENV variables
|
||||||
|
## http_proxy=http://privoxy:8118
|
||||||
|
## ALLOW_ACCESS_TO_HIDDEN_SERVICE=true
|
||||||
|
# tor:
|
||||||
|
# image: sirboops/tor
|
||||||
|
# networks:
|
||||||
|
# - external_network
|
||||||
|
# - internal_network
|
||||||
|
#
|
||||||
|
# privoxy:
|
||||||
|
# image: sirboops/privoxy
|
||||||
|
# volumes:
|
||||||
|
# - ./priv-config:/opt/config
|
||||||
|
# networks:
|
||||||
|
# - external_network
|
||||||
|
# - internal_network
|
||||||
|
|
||||||
|
networks:
|
||||||
|
external_network:
|
||||||
|
internal_network:
|
||||||
|
internal: true
|
|
@ -1,17 +1,27 @@
|
||||||
---
|
---
|
||||||
- name: Clone Mastodon repo
|
# - name: Clone Mastodon repo
|
||||||
git:
|
# git:
|
||||||
repo: https://github.com/mastodon/mastodon.git
|
# repo: https://github.com/mastodon/mastodon.git
|
||||||
dest: /usr/src/mastodon
|
# dest: "{{ mastodon_composer_folder }}"
|
||||||
depth: 1
|
# depth: 1
|
||||||
|
|
||||||
|
- name: Ensure mastodon folder exists
|
||||||
|
file:
|
||||||
|
path: "{{ mastodon_composer_folder }}"
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: Create docker-compose.yaml file
|
||||||
|
copy:
|
||||||
|
src: files/docker-compose.yml
|
||||||
|
dest: "{{ mastodon_composer_folder }}/docker-compose.yml"
|
||||||
|
|
||||||
- name: Ensure mastodon configuration is present
|
- name: Ensure mastodon configuration is present
|
||||||
template:
|
template:
|
||||||
src: templates/env.j2
|
src: templates/env.j2
|
||||||
dest: /usr/src/mastodon/.env.production
|
dest: "{{ mastodon_composer_folder }}/.env.production"
|
||||||
|
|
||||||
- name: Ensure Mastodon container is composed
|
- name: Ensure Mastodon container is composed
|
||||||
community.docker.docker_compose:
|
community.docker.docker_compose:
|
||||||
project_name: mastodon
|
project_name: mastodon
|
||||||
project_src: /usr/src/mastodon
|
project_src: "{{ mastodon_composer_folder }}/"
|
||||||
state: present
|
state: present
|
||||||
|
|
Loading…
Reference in a new issue