Browse Source

Add dockerfiles

pull/1/head
Dashie der otter 1 year ago
parent
commit
e68da32c3f
5 changed files with 93 additions and 0 deletions
  1. 3
    0
      .dockerignore
  2. 18
    0
      .drone.yml
  3. 31
    0
      Dockerfile-web
  4. 37
    0
      Dockerfile-worker
  5. 4
    0
      entrypoint.sh

+ 3
- 0
.dockerignore View File

@@ -0,0 +1,3 @@
.git
LICENSE
README.md

+ 18
- 0
.drone.yml View File

@@ -34,6 +34,24 @@ pipeline:
volumes:
- /tmp/cache:/cache

publish-web:
image: plugins/docker
repo: dashie/reel2bits-web
dockerfile: Dockerfile-web
tags: [ latest ]
secrets:
- DOCKER_USERNAME
- DOCKER_PASSWORD

publish-worker:
image: plugins/docker
repo: dashie/reel2bits-worker
dockerfile: Dockerfile-worker
tags: [ latest ]
secrets:
- DOCKER_USERNAME
- DOCKER_PASSWORD

notify:
image: plugins/slack
channel: gitea

+ 31
- 0
Dockerfile-web View File

@@ -0,0 +1,31 @@
# vim:set ft=dockerfile:
FROM python:3.6-alpine

LABEL maintainer="Dashie <dashie@sigpipe.me>"

LABEL org.label-schema.license=MIT \
org.label-schema.name=reel2bits-web \
org.label-schema.vcs-url=https://dev.sigpipe.me/dashie/reel2bits
org.label-schema.build-date=$DRONE_BUILD_STARTED \
org.label-schema.vcs-ref=$DRONE_COMMIT_SHA

RUN mkdir -p /app /data /config
WORKDIR /app

ADD requirements.txt /app/
RUN apk add --no-cache git libffi sox taglib libmagic tzdata libmad boost libsndfile libid3tag
RUN apk add --no-cache --virtual .build-deps gcc g++ libffi-dev
RUN pip install --no-cache-dir -r requirements.txt
RUN apk del .build-deps

ADD . /app/
ADD entrypoint.sh /
ADD config.py.sample /config/config.py

VOLUME ["/data", "/config"]

EXPOSE 5000

ENTRYPOINT ["/entrypoint.sh"]

CMD ["flask", "run"]

+ 37
- 0
Dockerfile-worker View File

@@ -0,0 +1,37 @@
# vim:set ft=dockerfile:
FROM python:3.6-alpine

LABEL maintainer="Dashie <dashie@sigpipe.me>"

LABEL org.label-schema.license=MIT \
org.label-schema.name=reel2bits-web \
org.label-schema.vcs-url=https://dev.sigpipe.me/dashie/reel2bits
org.label-schema.build-date=$DRONE_BUILD_STARTED \
org.label-schema.vcs-ref=$DRONE_COMMIT_SHA

RUN mkdir -p /app /data /config
WORKDIR /app

ADD requirements.txt /app/
RUN apk add --no-cache git libffi sox taglib libmagic tzdata libmad boost libsndfile libid3tag
RUN pip install --no-cache-dir -r requirements.txt
# Build audiowaveform
RUN apk add --no-cache --virtual .build-deps \
cmake gcc g++ make pkgconfig git boost-dev gd-dev libmad-dev libsndfile-dev libid3tag-dev wget && \
git clone https://github.com/bbcrd/audiowaveform.git /tmp/audiowaveform && cd /tmp/audiowaveform && \
wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz -O gmock-1.8.0.tar.gz && tar xzf gmock-1.8.0.tar.gz && \
ln -s googletest-release-1.8.0/googletest googletest && ln -s googletest-release-1.8.0/googlemock googlemock && \
mkdir build && cd build && cmake .. && make && cp audiowaveform /app/ && cd .. && rm -rf audiowaveform && \
apk del .build-deps

ADD . /app/
ADD entrypoint.sh /
ADD config.py.sample /config/config.py

VOLUME ["/data", "/config"]

EXPOSE 5000

ENTRYPOINT ["/entrypoint.sh"]

CMD ["dramatiq", "workers.py", "-q", "upload_workflow"]

+ 4
- 0
entrypoint.sh View File

@@ -0,0 +1,4 @@
#!/bin/sh
set -e

exec "$@"

Loading…
Cancel
Save