diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a51194c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +data +.idea diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..a8bbe4b --- /dev/null +++ b/.drone.yml @@ -0,0 +1,7 @@ +pipeline: + docker: + image: plugins/docker + repo: docker.jcg.re/coturn + registry: docker.jcg.re + secrets: [ docker_username, docker_password ] + tags: latest \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9e2fd7e..a51194c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,48 +1,2 @@ -# ---> JetBrains -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff: -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/dictionaries - -# Sensitive or high-churn files: -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.xml -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml - -# Gradle: -.idea/**/gradle.xml -.idea/**/libraries - -# Mongo Explorer plugin: -.idea/**/mongoSettings.xml - -## File-based project format: -*.iws - -## Plugin-specific files: - -# IntelliJ -/out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - +data +.idea diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c7667b0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM docker.jcg.re/base-alpine + +RUN apk add --no-cache \ + coturn \ + && mkdir /data + +ADD root / + +VOLUME /data \ No newline at end of file diff --git a/README.md b/README.md index bb488a5..0490a39 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,7 @@ -# docker-coturn +## docker.jcg.re/coturn +[![Build Status](https://drone.jcg.re/api/badges/jcgruenhage/docker-coturn/status.svg)](https://drone.jcg.re/jcgruenhage/docker-coturn) +Will probably not be documented any more than this. +You should be able to figure out how to use this if you take a look +at the run file at root/etc/s6.d/coturn/run, +the Dockerfile and [the coturn manpages](https://manpages.debian.org/stretch/coturn/index.html). \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..36f7e8f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +version: '2' + +services: + coturn: + image: docker.jcg.re/coturn + container_name: coturn + build: . + volumes: + - ./data:/data:z + ports: + - 3478:3478 \ No newline at end of file diff --git a/root/etc/s6.d/coturn/finish b/root/etc/s6.d/coturn/finish new file mode 100644 index 0000000..17980f1 --- /dev/null +++ b/root/etc/s6.d/coturn/finish @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +s6-svscanctl -t /etc/s6.d \ No newline at end of file diff --git a/root/etc/s6.d/coturn/run b/root/etc/s6.d/coturn/run new file mode 100755 index 0000000..01d4457 --- /dev/null +++ b/root/etc/s6.d/coturn/run @@ -0,0 +1,15 @@ +#!/usr/bin/env sh + +# copy default config file, if the config file doesn't exist. +if [ ! -f /data/turnserver.conf ]; then + cp /etc/coturn/turnserver.conf.default /data/turnserver.conf +fi + +# chown data +chown -R ${UID}:${GID} /data + +# run coturn +su-exec ${UID}:${GID} turnserver \ + -c /data/turnserver.conf \ + --db /data/user.db \ + --prod