Commit bc808a75 authored by Mathias Jud's avatar Mathias Jud

updated for traefik version 2

parent a14cce9e
docker-compose.yml
/.env
# data directory
/mariadb
/database-data
/upload-data
Codimd Configuration
====================
# Codimd Configuration
Ready to use codimd docker-compose configuration for a traefik web proxy.
......@@ -8,29 +7,27 @@ CodiMd is an collaborative markdown editor.
* codimd repository: https://github.com/hackmdio/codimd
Install
-------
## Install
```
# clone repository
git clone git@gitlab.wachter-jud.net:docker/codimd.git
git clone https://git.open-communication.net/open-communication/docker/codimd.git
# copy and edit the sample configuration file
# move into the project folder
cd codimd
cp docker-compose.yml.sample docker-compose.yml
# copy and edit the environment configuration file
cp sample.env .env
```
Edit docker-compose.yml and change the following value:
Edit the `.env` file and change the following value:
* `DatabaseRootPassword` create a new safe password
* `DatabaseUserPassword` create a new safe password
* `your.codimd.domain` the domain name under which this codimd will be available
Usage
-----
## Start & Stop Codimd
```
# start codimd
......@@ -43,5 +40,12 @@ docker-compose down
docker-compose pull
```
## Further Customization
In order to be able to upload data you need to change the permissions of the folder `upload-data`.
Allow user named `hackmd` in the docker to access the volume, which user id and group id are `uid=1500`, `gid=1500`.
You can change the volume permission though this command: `chown -R 1500:1500 upload-data`.
For more information see codimd documentation:
https://hackmd.io/c/codimd-documentation/%2Fs%2Fcodimd-docker-deployment
## docker-compose configuration file for codimd collaborative
## markdown editor
##
## To configure this service, edit the `.env` file
##
version: '3'
services:
database:
image: postgres:11.6-alpine
environment:
- POSTGRES_USER=codimd
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=codimd
volumes:
- ./database-data:/var/lib/postgresql/data
labels:
- "traefik.enable=false"
networks:
- traefik_network
restart: always
codimd:
image: hackmdio/hackmd:2.4.1
environment:
- CMD_DB_URL=postgres://codimd:${DB_PASSWORD}@database/codimd
- CMD_USECDN=false
labels:
- traefik.port=3000
- "traefik.http.routers.${ROUTERNAME}.rule=Host(${DOMAIN})"
- "traefik.http.routers.${ROUTERNAME}.entrypoints=websecure"
- "traefik.http.routers.${ROUTERNAME}.tls.certresolver=myresolver"
depends_on:
- database
networks:
- traefik_network
# ports:
# - "3000:3000"
volumes:
- ./upload-data:/home/hackmd/app/public/uploads
restart: always
#volumes:
# database-data: {}
# upload-data: {}
networks:
traefik_network:
external:
name: traefik_default
## docker-compose configuration file for nextcloud web cloud
##
## name this file docker-compose.yml
## and edit the following values:
##
## DatabaseRootPassword
## DatabaseUserPassword
## your.codimd.domain
##
version: '2'
services:
codimd-db:
image: mariadb:10
environment:
##############################################
## Edit the following values ##
##############################################
- MYSQL_ROOT_PASSWORD=DatabaseRootPassword
- MYSQL_PASSWORD=DatabaseUserPassword
##############################################
- MYSQL_DATABASE=hackmd
- MYSQL_USER=hackmd
volumes:
- mariadb:/var/lib/mysql
- ./resources/utf8.cnf:/etc/mysql/conf.d/utf8.cnf
labels:
- "traefik.enable=false"
networks:
- traefik_network
restart: always
codimd:
image: hackmdio/hackmd:1.3.0
environment:
##############################################
## Copy the value from codimd-db section ##
##############################################
- CMD_DB_URL=mysql://hackmd:DatabaseUserPassword@codimd-db:3306/hackmd
##############################################
restart: always
labels:
##############################################
## Edit the following value ##
##############################################
- traefik.frontend.rule=Host:your.codimd.domain
##############################################
- traefik.port=3000
- traefik.frontend.passHostHeader=true
- "traefik.frontend.entryPoints=http,https"
depends_on:
- codimd-db
networks:
- traefik_network
# ports:
# - "3000:3000"
networks:
traefik_network:
external:
name: traefik_default
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
# Environment Variables for Docker-Compose
# Please Configure them accordingly
## Enter the domain name under which this
## service shall be reachable.
## An SSL certificated will be created for this domain.
DOMAIN=`my.domain.com`
## Choose a unique router name.
## This name must not include dots or spaces.
ROUTERNAME=Choose_A_Unique_Codimd_Router_Name
## Password of the data base
DB_PASSWORD=ReplaceWithANewPassword
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment