/previews/
/logs/
/server/tools/import-mediacore.ts
+/docker-volume/
the environment variables:
```bash
-$ PEERTUBE_HOSTNAME=peertube.lvh.me \
+$ PEERTUBE_WEBSERVER_HOSTNAME=peertube.lvh.me \
PEERTUBE_ADMIN_EMAIL=test@example.com \
PEERTUBE_TRANSCODING_ENABLED=true \
PEERTUBE_SIGNUP_ENABLED=true \
RUN yarn install --pure-lockfile \
&& npm run build
-# Configure PeerTube
-RUN cp /app/config/default.yaml /app/support/docker/production/config/default.yaml
+USER root
+
+RUN mkdir /data /config
+RUN chown -R peertube:peertube /data /config
+
ENV NODE_ENV production
-ENV NODE_CONFIG_DIR /app/support/docker/production/config
+ENV NODE_CONFIG_DIR /config
-USER root
-RUN mkdir /data && chown peertube:peertube /data
VOLUME /data
+VOLUME /config
COPY ./support/docker/production/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
webserver:
- hostname: "PEERTUBE_HOSTNAME"
+ hostname: "PEERTUBE_WEBSERVER_HOSTNAME"
port:
- __name: "PEERTUBE_PORT"
+ __name: "PEERTUBE_WEBSERVER_PORT"
__format: "json"
https:
- __name: "PEERTUBE_HTTPS"
+ __name: "PEERTUBE_WEBSERVER_HTTPS"
__format: "json"
database:
# dockerfile: ./support/docker/production/Dockerfile.stretch
image: chocobozzz/peertube:production-stretch
environment:
- PEERTUBE_HOSTNAME: my.domain.tld
- PEERTUBE_PORT: 443
- PEERTUBE_HTTPS: "true"
+ PEERTUBE_WEBSERVER_HOSTNAME: my.domain.tld
+ PEERTUBE_WEBSERVER_PORT: 443
+ PEERTUBE_WEBSERVER_HTTPS: "true"
PEERTUBE_ADMIN_EMAIL: admin@domain.tld
PEERTUBE_DB_HOSTNAME: postgres
PEERTUBE_DB_USERNAME: postgres_user
# remove them if you are using another reverse proxy.
labels:
traefik.enable: "true"
- traefik.frontend.rule: "Host:${PEERTUBE_HOSTNAME}"
+ traefik.frontend.rule: "Host:${PEERTUBE_WEBSERVER_HOSTNAME}"
traefik.port: "9000"
# If you don't want to use a reverse proxy (not suitable for production!)
# ports:
# - "80:9000"
volumes:
- - ./data:/data
+ - ./docker-volume/data:/data
+ - ./docker-volume/config:/config
depends_on:
- postgres
- redis
POSTGRES_PASSWORD: postgres_password
POSTGRES_DB: peertube
volumes:
- - ./db:/var/lib/postgresql/data
+ - ./docker-volume/db:/var/lib/postgresql/data
restart: "always"
redis:
image: redis:4-alpine
volumes:
- - ./redis:/data
+ - ./docker-volume/redis:/data
restart: "always"
#!/bin/sh
set -e
+# Populate config directory
+if [ -z "$(ls -A /config)" ]; then
+ cp /app/support/docker/production/config/* /config
+ cp /app/config/default.yaml /config
+ chown -R peertube:peertube /config
+fi
+
# first arg is `-f` or `--some-option`
# or first arg is `something.conf`
if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then
+++ /dev/null
-version: "3.3"
-
-services:
- app:
- image: peertube:stretch
- environment:
- PEERTUBE_HOSTNAME: my.domain.tld
- PEERTUBE_PORT: 443
- PEERTUBE_HTTPS: true
- PEERTUBE_ADMIN_EMAIL: admin@domain.tld
- PEERTUBE_DB_USERNAME: user
- PEERTUBE_DB_PASSWORD: password
- PEERTUBE_SIGNUP_ENABLED: true
- PEERTUBE_TRANSCODING_ENABLED: true
- labels: &labels
- traefik.frontend.rule: "Host:my.domain.tld"
- traefik.docker.network: traefik
- traefik.port: "9000"
- volumes:
- - app_data:/usr/src/app/data
- networks:
- - traefik
- - backend
- depends_on:
- - db
- deploy:
- labels: *labels
- placement:
- constraints:
- - node.labels.peertube == 1
-
- db:
- image: postgres:10
- environment:
- POSTGRES_DB: peertube_prod
- volumes:
- - db_data:/var/lib/postgresql/data
- networks:
- - backend
- deploy:
- placement:
- constraints:
- - node.labels.peertube == 1
-
-volumes:
- app_data:
- db_data:
-
-networks:
- backend:
- traefik:
- external: true