Skip to content

Instantly share code, notes, and snippets.

@hfziu
Last active June 14, 2019 10:59
Show Gist options
  • Save hfziu/a74c72f0a2299d22286c57d02271a96a to your computer and use it in GitHub Desktop.
Save hfziu/a74c72f0a2299d22286c57d02271a96a to your computer and use it in GitHub Desktop.
Docker compose file for WordPress and Tiny Tiny RSS website. TTRSS 部分改自:https://github.com/HenryQW/Awesome-TTRSS
version: '2.1'
services:
database.postgres:
image: sameersbn/postgresql:latest
container_name: postgres
environment:
- PG_PASSWORD=password # please change the password
- DB_EXTENSION=pg_trgm
volumes:
- ttrss_pgdata:/var/lib/postgresql/ # persist postgres data to ~/postgres/data/ on the host
restart: always
service.rss:
image: wangqiru/ttrss:latest
container_name: ttrss
expose:
- 80
environment:
- VIRTUAL_HOST=rss.example.com # please change to your own domain
- LETSENCRYPT_HOST=rss.example.com # please change to your own domain
- LETSENCRYPT_EMAIL=admin@example.com # please change to your own domain
- SELF_URL_PATH=https://rss.example.com/ # please change to your own domain
- DB_HOST=database.postgres
- DB_PORT=5432
- DB_NAME=ttrss
- DB_USER=postgres
- DB_PASS=password # please change the password
- ENABLE_PLUGINS=auth_internal,fever # auth_internal is required. Plugins enabled here will be enabled for all users as system plugins
stdin_open: true
tty: true
restart: always
command: sh -c 'sh /wait-for.sh database.postgres:5432 -- php /configure-db.php && exec s6-svscan /etc/s6/'
networks:
- proxy-tier
- default
service.mercury: # set Mercury Parser API endpoint to `service.mercury:3000` on TTRSS plugin setting page
image: wangqiru/mercury-parser-api:latest
container_name: mercury
expose:
- 3000
restart: always
service.opencc: # set OpenCC API endpoint to `service.opencc:3000` on TTRSS plugin setting page
image: wangqiru/opencc-api-server:latest
container_name: opencc
environment:
NODE_ENV: production
expose:
- 3000
restart: always
wp.db:
image: mysql:5.7
volumes:
- wp_db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: password # change the password
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- wp.db
image: wordpress:latest
expose:
- 80
restart: always
environment:
- VIRTUAL_HOST=blog.example.com # please change to your own domain
- LETSENCRYPT_HOST=blog.example.com # please change to your own domain
- LETSENCRYPT_EMAIL=admin@example.com # please change to your own domain
- WORDPRESS_DB_HOST=wp.db:3306
- WORDPRESS_DB_USER=wordpress
- WORDPRESS_DB_PASSWORD=wordpress
- WORDPRESS_DB_NAME=wordpress
networks:
- proxy-tier
- default
proxy:
image: jwilder/nginx-proxy:alpine
restart: always
ports:
- 80:80
- 443:443
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
volumes:
- certs:/etc/nginx/certs:ro
- vhost.d:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
- proxy-tier
letsencrypt-companion:
image: jrcs/letsencrypt-nginx-proxy-companion
restart: always
volumes:
- certs:/etc/nginx/certs
- vhost.d:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- proxy-tier
depends_on:
- proxy
volumes:
ttrss_pgdata:
driver_opts:
type: none
o: bind
device: /example_path/_ttrss_pgdata # change path
certs:
driver_opts:
type: none
o: bind
device: /example_path/_certs # change path
vhost.d:
driver_opts:
type: none
o: bind
device: /example_path/_vhost.d # change path
html:
driver_opts:
type: none
o: bind
device: /example_path/_html # change path
wp_db_data:
driver_opts:
type: none
o: bind
device: /example_path/_wp_db_data # change path
networks:
proxy-tier:
default:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment