Skip to content

Instantly share code, notes, and snippets.

@aeris
Created April 16, 2018 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aeris/c6a5b0200423446ae964d0279153a1c8 to your computer and use it in GitHub Desktop.
Save aeris/c6a5b0200423446ae964d0279153a1c8 to your computer and use it in GitHub Desktop.
cozy-docker-https
COMPOSE_PROJECT_NAME=cozy-https
host: 0.0.0.0
port: 8080
subdomains: nested
admin:
host: 0.0.0.0
port: 6060
secret_filename: cozy-admin-passphrase
fs:
url: file://localhost/var/lib/cozy
couchdb:
url: http://{{.Env.COZY_COUCHDHB_USER}}:{{.Env.COZY_COUCHDB_PASSWORD}}@{{.Env.COZY_COUCHDB_HOST}}:{{.Env.COZY_COUCHDB_PORT}}/
jobs:
workers: 1
konnectors:
cmd: ./scripts/konnector-node-run.sh
mail:
noreply_address: noreply@localhost
host: {{.Env.COZY_MAIL_HOST}}
port: {{.Env.COZY_MAIL_PORT}}
disable_tls: true
log:
level: info
syslog: false
password_reset_interval: {{.Env.COZY_PASSWORD_RESET_INTERVAL}}
version: "3.4"
services:
couchdb:
image: couchdb:2.1
environment:
COUCHDB_USER: cozy
COUCHDB_PASSWORD: cozy
mailhog:
image: mailhog/mailhog:v1.0.0
ports:
- "8025:8025"
stack:
build: .
image: cozy/cozy-stack
# labels:
# traefik.enable: true
links:
- couchdb
- mailhog
traefik:
image: traefik:1.5-alpine
command: --api --traefiklog
# command: --api
ports:
- "8080:8080"
- "1080:80"
- "1443:443"
links:
- stack
volumes:
# - /var/run/docker.sock:/var/run/docker.sock
- /home/docker/traefik.toml:/etc/traefik/traefik.toml
- /home/docker/localhost.pem:/etc/traefik/localhost.pem
- /home/docker/localhost.crt:/etc/traefik/localhost.crt
FROM golang:1.9-alpine3.7 AS builder
RUN apk add --update git
RUN go get -u github.com/cozy/cozy-stack
FROM alpine:3.7
RUN apk add --update git imagemagick
COPY --from=builder /go/bin/cozy-stack /usr/local/bin/
COPY ./cozy.yaml /etc/cozy/
EXPOSE 8080
VOLUME /etc/cozy/ /var/lib/cozy/
ENV COZY_COUCHDHB_USER=cozy COZY_COUCHDB_PASSWORD=cozy COZY_COUCHDB_HOST=couchdb COZY_COUCHDB_PORT=5984 COZY_MAIL_HOST=mailhog COZY_MAIL_PORT=1025 COZY_PASSWORD_RESET_INTERVAL=0
CMD ["/usr/local/bin/cozy-stack", "serve", "--allow-root"]
defaultEntryPoints = ["http", "https"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[[entryPoints.https.tls.certificates]]
keyFile = "/etc/traefik/localhost.pem"
certFile = "/etc/traefik/localhost.crt"
[file]
watch = true
[backends]
[backends.stack]
[backends.stack.servers.stack]
url = "http://stack:8080"
[frontends]
[frontends.stack]
backend = "stack"
passHostHeader = true
[frontends.stack.routes.all]
rule = "PathPrefix:/"
#[docker]
#endpoint = "unix:///var/run/docker.sock"
#domain = "docker.localhost"
#watch = true
#exposedbydefault = false
#usebindportip = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment