add alpine image
This commit is contained in:
parent
762506be99
commit
95eecb4528
|
@ -1,11 +1,18 @@
|
|||
pipeline:
|
||||
build:
|
||||
build-debian:
|
||||
image: plugins/docker
|
||||
registry: registry.dryusdan.fr
|
||||
repo: registry.dryusdan.fr/dryusdan/peertube
|
||||
dockerfile: Dockerfile.debian
|
||||
secrets: [ docker_username, docker_password ]
|
||||
|
||||
build-alpine:
|
||||
image: plugins/docker
|
||||
registry: registry.dryusdan.fr
|
||||
repo: registry.dryusdan.fr/dryusdan/peertube:alpine
|
||||
dockerfile: Dockerfile.alpine
|
||||
secrets: [ docker_username, docker_password ]
|
||||
|
||||
push:
|
||||
image: appleboy/drone-git-push
|
||||
branch: master
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
FROM alpine:3.7
|
||||
|
||||
ENV UID=991 GID=991 \
|
||||
HTTPS=false \
|
||||
HOSTNAME=peertube.localhost \
|
||||
PORT=80 \
|
||||
DATABASE_HOST=localhost \
|
||||
DATABASE_PORT=5432 \
|
||||
DATABASE_USERNAME=peertube \
|
||||
DATABASE_PASSWORD=peertube \
|
||||
ADMIN_EMAIL=admin@domain.local \
|
||||
SIGNUP_ENABLE=false \
|
||||
TRANSCODING_ENABLE=false \
|
||||
TRANSCODING_THREADS=2 \
|
||||
BODY_SIZE=100M \
|
||||
CACHE_SIZE=100 \
|
||||
SIGNUP_LIMIT=10 \
|
||||
VIDEO_QUOTA=-1 \
|
||||
RESOLUTION_280=true \
|
||||
RESOLUTION_360=true \
|
||||
RESOLUTION_480=true \
|
||||
RESOLUTION_720=true \
|
||||
RESOLUTION_1080=true \
|
||||
DEBIAN_FRONTEND=noninteractiv
|
||||
|
||||
RUN addgroup -g 991 peertube && useradd -u 991 -G 991 -h /home/peertube \
|
||||
&& apk -U add curl ffmpeg openssl git nginx yarn nodejs build-base su-exec shadow \
|
||||
&& git clone --branch ${PEERTUBE_VER} https://github.com/Chocobozzz/PeerTube /PeerTube \
|
||||
&& echo "****** chown ******" \
|
||||
&& chown -R peertube:peertube PeerTube \
|
||||
&& cd /PeerTube \
|
||||
&& echo "****** run npm install as user ******" \
|
||||
&& su-exec peertube:peertube "cd /PeerTube && npm install" \
|
||||
&& echo "****** run yarn install as user ******" \
|
||||
&& su-exec peertube:peertube "cd /PeerTube && yarn install" \
|
||||
&& echo "****** run npm run build as user ******" \
|
||||
&& su-exec peertube:peertube "cd /PeerTub && npm run build" \
|
||||
&& apk del git build-base \
|
||||
&& rm -rf /tmp/* /PeerTube.git /var/cache/apk/*
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
COPY rootfs /
|
||||
|
||||
RUN chmod +x /usr/local/bin/startup-alpine
|
||||
|
||||
WORKDIR /PeerTube/
|
||||
|
||||
VOLUME ["/PeerTube/certs", "/PeerTube/videos", "/PeerTube/logs", "/PeerTube/previews", "/PeerTube/thumbnails", "/PeerTube/torrents"]
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/startup-alpine"]
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
#!/bin/sh
|
||||
|
||||
#groupadd -g ${GID} peertube && useradd -u ${UID} -M -g ${GID} peertube
|
||||
|
||||
usermod -u ${GID} peertube
|
||||
groupmod -g ${UID} peertube
|
||||
|
||||
sed -i -e 's|<https>|'${HTTPS}'|' \
|
||||
-e 's|<hostname>|'${HOSTNAME}'|' \
|
||||
-e 's|<port>|'${PORT}'|' \
|
||||
-e 's|<database_host>|'${DATABASE_HOST}'|' \
|
||||
-e 's|<database_port>|'${DATABASE_PORT}'|' \
|
||||
-e 's|<database_username>|'${DATABASE_USERNAME}'|' \
|
||||
-e 's|<database_password>|'${DATABASE_PASSWORD}'|' \
|
||||
-e 's|<admin_email>|'${ADMIN_EMAIL}'|' \
|
||||
-e 's|<signup_enabled>|'${SIGNUP_ENABLE}'|' \
|
||||
-e 's|<transcoding_enable>|'${TRANSCODING_ENABLE}'|' \
|
||||
-e 's|<transcoding_threads>|'${TRANSCODING_THREADS}'|' \
|
||||
-e 's|<cache_size>|'${CACHE_SIZE}'|' \
|
||||
-e 's|<signup_limit>|'${SIGNUP_LIMIT}'|' \
|
||||
-e 's|<video_quota>|'${VIDEO_QUOTA}'|' \
|
||||
-e 's|<resolution_280>|'${RESOLUTION_280}'|' \
|
||||
-e 's|<resolution_360>|'${RESOLUTION_360}'|' \
|
||||
-e 's|<resolution_480>|'${RESOLUTION_480}'|' \
|
||||
-e 's|<resolution_720>|'${RESOLUTION_720}'|' \
|
||||
-e 's|<resolution_1080>|'${RESOLUTION_1080}'|' /PeerTube/config/production.yaml
|
||||
|
||||
sed -i -e 's|<body_size>|'${BODY_SIZE}'|' /etc/nginx/sites-enabled/peertube.conf
|
||||
|
||||
chown -R $UID:$GID /home/peertube
|
||||
chown -R $UID:$GID /PeerTube
|
||||
|
||||
nginx
|
||||
if [ $# -eq 0 ]; then
|
||||
exec su-exec peertube:peertube NODE_ENV=production npm start
|
||||
else
|
||||
exec su-exec peertube:peertube NODE_ENV=production npm $#
|
||||
fi
|
Reference in New Issue