Advertisement
Guest User

docker-compose codimd + traaefik

a guest
Mar 22nd, 2019
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.68 KB | None | 0 0
  1. # Using version 3 to provide play-with-docker badge
  2. # You can change to version 2 without breaking.
  3. #version: '2'
  4. version: '3'
  5. services:
  6.   database:
  7.    # Don't upgrade PostgreSQL by simply changing the version number
  8.     # You need to migrate the Database to the new PostgreSQL version
  9.     image: postgres:9.6-alpine
  10.     #mem_limit: 256mb         # version 2 only
  11.     #memswap_limit: 512mb     # version 2 only
  12.     #read_only: true          # not supported in swarm mode please enable along with tmpfs
  13.     #tmpfs:
  14.     #  - /run/postgresql:size=512K
  15.     #  - /tmp:size=256K
  16.     environment:
  17.      - POSTGRES_USER=hackmd
  18.       - POSTGRES_PASSWORD=hackmdpass
  19.       - POSTGRES_DB=hackmd
  20.     volumes:
  21.      - database:/var/lib/postgresql/data
  22.     networks:
  23.       backend:
  24.     restart: always
  25.  
  26.   # MySQL example
  27.   # Most of the documentation that applies to PostgreSQL applies also to MySQL
  28.   #database:
  29.   #    # You should be able to upgrade MySQL without problems
  30.   #    # but to make sure no even when a problem appears you
  31.   #    # should have a backup
  32.   #    image: mariadb:10
  33.   #    environment:
  34.   #      - MYSQL_USER=hackmd
  35.   #      - MYSQL_PASSWORD=hackmdpass
  36.   #      - MYSQL_DATABASE=hackmd
  37.   #      - MYSQL_ALLOW_EMPTY_PASSWORD=true
  38.   #    volumes:
  39.   #      - database:/var/lib/mysql
  40.   #      # This config provides UTF-8 support to the database by default
  41.   #      # If this config is not used, HackMD breaks as it tries to write
  42.   #      # UTF-8 to a latin database.
  43.   #      - ./resources/utf8.cnf:/etc/mysql/conf.d/utf8.cnf
  44.   #    networks:
  45.   #      backend:
  46.   #    restart: always
  47.  
  48.   app:
  49.    # Uncomment the following section to build the image yourself:
  50.     #build:
  51.     #  context: .
  52.     #  dockerfile: debian/Dockerfile
  53.     #  args:
  54.     #    - "VERSION=master"
  55.     #    - "CODIMD_REPOSITORY=https://github.com/hackmdio/codimd.git"
  56.     image: hackmdio/hackmd:1.3.0
  57.     #mem_limit: 256mb         # version 2 only
  58.     #memswap_limit: 512mb     # version 2 only
  59.     #read_only: true          # not supported in swarm mode, enable along with tmpfs
  60.     #tmpfs:
  61.     #  - /tmp:size=512K
  62.     #  - /codimd/tmp:size=1M
  63.     #  # Make sure you remove this when you use filesystem as upload type
  64.     #  - /codimd/public/uploads:size=10M
  65.     environment:
  66.      # DB_URL is formatted like: <databasetype>://<username>:<password>@<hostname>/<database>
  67.       # Other examples are:
  68.       # - mysql://hackmd:hackmdpass@database:3306/hackmd
  69.       # - sqlite:///data/sqlite.db (NOT RECOMMENDED)
  70.       # - For details see the official sequelize docs: http://docs.sequelizejs.com/en/v3/
  71.       - CMD_DB_URL=postgres://hackmd:hackmdpass@database:5432/hackmd
  72.     ports:
  73.      # Ports that are published to the outside.
  74.       # The latter port is the port inside the container. It should always stay on 3000
  75.       # If you only specify a port it'll published on all interfaces. If you want to use a
  76.       # local reverse proxy, you may want to listen on 127.0.0.1.
  77.       # Example:
  78.       # - "127.0.0.1:3000:3000"
  79.       - "127.0.0.1:3000:3000"
  80.     labels:
  81.      - "traefik.enable=true"
  82.       - "traefik.backend=codimd"
  83.       - "traefik.frontend.rule=Host:md.ruffat.org"  
  84. #      - "traefik.frontend.rule=Host:ruffat.org; PathPrefixStrip: /traefik"
  85.       - "traefik.port=3000"
  86.       - "traefik.docker.network=traefik_proxy"
  87.     networks:
  88.       backend:
  89.       traefik_proxy:
  90.     restart: always
  91.     depends_on:
  92.      - database
  93.  
  94. # Define networks to allow best isolation
  95. networks:
  96.  # Internal network for communication with PostgreSQL/MySQL
  97.   traefik_proxy:
  98.   backend:
  99. # Define named volumes so data stays in place
  100. volumes:
  101.  # Volume for PostgreSQL/MySQL database
  102.   database:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement