| 1 | ## |
| 2 | ## After making changes to this file, you MUST rebuild for any changes |
| 3 | ## to take effect in your live Discourse instance: |
| 4 | ## |
| 5 | ## /var/discourse/launcher rebuild app |
| 6 | ## |
| 7 | |
| 8 | ## this is the all-in-one, standalone Discourse Docker container template |
| 9 | |
| 10 | # You may add rate limiting to by commenting out the ratelimited template. |
| 11 | # Out of the box it allows 12 reqs a second per ip, and 100 per minute per ip |
| 12 | # This is configurable by amending the params in this file |
| 13 | |
| 14 | templates: |
| 15 | - "templates/postgres.template.yml" |
| 16 | - "templates/redis.template.yml" |
| 17 | - "templates/web.template.yml" |
| 18 | - "templates/sshd.template.yml" |
| 19 | #- "templates/web.ratelimited.template.yml" |
| 20 | |
| 21 | ## which TCP/IP ports should this container expose? |
| 22 | expose: |
| 23 | - "80:80" # fwd host port 80 to container port 80 (http) |
| 24 | - "2222:22" # fwd host port 2222 to container port 22 (ssh) |
| 25 | |
| 26 | params: |
| 27 | db_default_text_search_config: "pg_catalog.english" |
| 28 | ## Set db_shared_buffers to 1/3 of the memory you wish to allocate to postgres |
| 29 | ## on 1GB install set to 128MB on a 4GB instance you may raise to 1GB |
| 30 | #db_shared_buffers: "256MB" |
| 31 | # |
| 32 | ## Which Git revision should this container use? (default: tests-passed) |
| 33 | #version: tests-passed |
| 34 | |
| 35 | env: |
| 36 | LANG: en_US.UTF-8 |
| 37 | ## TODO: How many concurrent web requests are supported? |
| 38 | ## With 2GB we recommend 3-4 workers, with 1GB only 2 |
| 39 | #UNICORN_WORKERS: 3 |
| 40 | ## |
| 41 | ## TODO: List of comma delimited emails that will be made admin and developer |
| 42 | ## on initial signup example 'user1@example.com, user2@example.com' |
| 43 | DISCOURSE_DEVELOPER_EMAILS: 'me@example.com' |
| 44 | ## |
| 45 | ## TODO: The domain name this Discourse instance will respond to |
| 46 | DISCOURSE_HOSTNAME: 'discourse.example.com' |
| 47 | ## |
| 48 | ## TODO: The mailserver this Discourse instance will use |
| 49 | DISCOURSE_SMTP_ADDRESS: smtp.example.com # (mandatory) |
| 50 | #DISCOURSE_SMTP_PORT: 587 # (optional) |
| 51 | #DISCOURSE_SMTP_USER_NAME: user@example.com # (optional) |
| 52 | #DISCOURSE_SMTP_PASSWORD: pa$$word # (optional) |
| 53 | ## |
| 54 | ## The CDN address for this Discourse instance (configured to pull) |
| 55 | #DISCOURSE_CDN_URL: //discourse-cdn.example.com |
| 56 | |
| 57 | ## These containers are stateless, all data is stored in /shared |
| 58 | volumes: |
| 59 | - volume: |
| 60 | host: /var/discourse/shared/standalone |
| 61 | guest: /shared |
| 62 | - volume: |
| 63 | host: /var/discourse/shared/standalone/log/var-log |
| 64 | guest: /var/log |
| 65 | |
| 66 | ## The docker manager plugin allows you to one-click upgrade Discouse |
| 67 | ## http://discourse.example.com/admin/docker |
| 68 | hooks: |
| 69 | after_code: |
| 70 | - exec: |
| 71 | cd: $home/plugins |
| 72 | cmd: |
| 73 | - mkdir -p plugins |
| 74 | - git clone https://github.com/discourse/docker_manager.git |
| 75 | |
| 76 | ## Remember, this is YAML syntax - you can only have one block with a name |
| 77 | run: |
| 78 | - exec: echo "Beginning of custom commands" |
| 79 | |
| 80 | ## If you want to configure password login for root, uncomment and change: |
| 81 | #- exec: apt-get -y install whois # for mkpasswd |
| 82 | ## Use only one of the following lines: |
| 83 | #- exec: /usr/sbin/usermod -p 'PASSWORD_HASH' root |
| 84 | #- exec: /usr/sbin/usermod -p "$(mkpasswd -m sha-256 'RAW_PASSWORD')" root |
| 85 | |
| 86 | ## If you want to authorized additional users, uncomment and change: |
| 87 | #- exec: ssh-import-id username |
| 88 | #- exec: ssh-import-id anotherusername |
| 89 | |
| 90 | - exec: echo "End of custom commands" |
| 91 | - exec: awk -F\# '{print $1;}' ~/.ssh/authorized_keys | awk 'BEGIN { print "Authorized SSH keys for this container:"; } NF>=2 {print $NF;}' |