Skip to content
Snippets Groups Projects
Unverified Commit 1a83b5e6 authored by Jan Christian Grünhage's avatar Jan Christian Grünhage
Browse files

Add Dockerfile

parent 199d813e
No related branches found
No related tags found
No related merge requests found
FROM docker.io/alpine
COPY . /tmp/src
RUN apk add --no-cache \
su-exec \
&& apk add --no-cache \
-t build-deps \
go \
git \
musl-dev \
&& cd /tmp/src \
&& 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 docker/run.sh /usr/local/bin \
&& cp config.sample.yaml /etc/media-repo.yaml.sample \
&& cp -R migrations /var/lib/media-repo-migrations \
&& cd / \
&& rm -rf /tmp/* \
&& apk del build-deps
CMD /usr/local/bin/run.sh
VOLUME ["/data", "/media"]
EXPOSE 8000
#!/usr/bin/env sh
cd /data
if [ ! -f media-repo.yaml ]; then
cp /etc/media-repo.yaml.sample media-repo.yaml
fi
chown -R ${UID}:${GID} /data
exec su-exec ${UID}:${GID} media_repo -migrations /var/lib/media-repo-migrations
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment