initial impl
All checks were successful
the build was successful

This commit is contained in:
Jan Christian Grünhage 2018-01-13 15:21:19 +01:00
parent f1fea4ff29
commit d671ada6b7
Signed by: jcgruenhage
GPG key ID: 6594C449C633D10C
5 changed files with 45 additions and 2 deletions

7
.drone.yml Normal file
View file

@ -0,0 +1,7 @@
pipeline:
docker:
image: plugins/docker
repo: docker.jcg.re/media-repo
registry: docker.jcg.re
secrets: [docker_username, docker_password]
tags: latest

23
Dockerfile Normal file
View file

@ -0,0 +1,23 @@
FROM docker.jcg.re/base-alpine
RUN apk add --no-cache \
-t build-deps \
go \
git \
musl-dev \
&& cd /tmp \
&& git clone https://github.com/turt2live/matrix-media-repo \
&& cd matrix-media-repo \
&& GOPATH=`pwd` go get github.com/constabulary/gb/... \
&& PATH=$PATH:`pwd`/bin gb vendor restore \
&& GOPATH=`pwd`:`pwd`/vendor go build -o bin/media_repo ./src/github.com/turt2live/matrix-media-repo/cmd/media_repo/ \
&& GOPATH=`pwd`:`pwd`/vendor go build -o bin/import_synapse ./src/github.com/turt2live/matrix-media-repo/cmd/import_synapse/ \
&& cp bin/media_repo bin/import_synapse /usr/local/bin \
&& cp config.sample.yaml /etc/media_repo.yaml.sample \
&& cd / \
&& rm -rf /tmp/* \
&& apk del build-deps
COPY root /
VOLUME /data
EXPOSE 8000

View file

@ -1,3 +1,4 @@
# docker-turt2live-matrix-media-repo ## docker.jcg.re/media-repo
[![Build Status](https://drone.jcg.re/api/badges/jcgruenhage/docker-media-repo/status.svg)](https://drone.jcg.re/jcgruenhage/docker-media-repo)
A dockerization of Travis's Media Repository: https://github.com/turt2live/matrix-media-repo A dockerization of [Travis' Media Repository](https://github.com/turt2live/matrix-media-repo).

View file

@ -0,0 +1,2 @@
#!/usr/bin/env sh
s6-svscanctl -t /etc/s6.d

10
root/etc/s6.d/media-repo/run Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env sh
chown -R ${UID}:${GID} /data
cd /data
if [ ! -f media_repo.yaml ]; then
cp /etc/media_repo.yaml.sample media_repo.yaml
fi
exec su-exec ${UID}:${GID} media_repo