Browse Source

Add dockerfiles

Dashie der otter 4 months 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 @@
1
+.git
2
+LICENSE
3
+README.md

+ 18
- 0
.drone.yml View File

@@ -34,6 +34,24 @@ pipeline:
34 34
       volumes:
35 35
           - /tmp/cache:/cache
36 36
 
37
+  publish-web:
38
+    image: plugins/docker
39
+    repo: dashie/reel2bits-web
40
+    dockerfile: Dockerfile-web
41
+    tags: [ latest ]
42
+    secrets:
43
+        - DOCKER_USERNAME
44
+        - DOCKER_PASSWORD
45
+
46
+  publish-worker:
47
+    image: plugins/docker
48
+    repo: dashie/reel2bits-worker
49
+    dockerfile: Dockerfile-worker
50
+    tags: [ latest ]
51
+    secrets:
52
+        - DOCKER_USERNAME
53
+        - DOCKER_PASSWORD
54
+
37 55
   notify:
38 56
     image: plugins/slack
39 57
     channel: gitea

+ 31
- 0
Dockerfile-web View File

@@ -0,0 +1,31 @@
1
+# vim:set ft=dockerfile:
2
+FROM python:3.6-alpine
3
+
4
+LABEL maintainer="Dashie <dashie@sigpipe.me>"
5
+
6
+LABEL org.label-schema.license=MIT \
7
+    org.label-schema.name=reel2bits-web \
8
+    org.label-schema.vcs-url=https://dev.sigpipe.me/dashie/reel2bits
9
+    org.label-schema.build-date=$DRONE_BUILD_STARTED \
10
+    org.label-schema.vcs-ref=$DRONE_COMMIT_SHA
11
+
12
+RUN mkdir -p /app /data /config
13
+WORKDIR /app
14
+
15
+ADD requirements.txt /app/
16
+RUN apk add --no-cache git libffi sox taglib libmagic tzdata libmad boost libsndfile libid3tag
17
+RUN apk add --no-cache --virtual .build-deps gcc g++ libffi-dev
18
+RUN pip install --no-cache-dir -r requirements.txt
19
+RUN apk del .build-deps
20
+
21
+ADD . /app/
22
+ADD entrypoint.sh /
23
+ADD config.py.sample /config/config.py
24
+
25
+VOLUME ["/data", "/config"]
26
+
27
+EXPOSE 5000
28
+
29
+ENTRYPOINT ["/entrypoint.sh"]
30
+
31
+CMD ["flask", "run"]

+ 37
- 0
Dockerfile-worker View File

@@ -0,0 +1,37 @@
1
+# vim:set ft=dockerfile:
2
+FROM python:3.6-alpine
3
+
4
+LABEL maintainer="Dashie <dashie@sigpipe.me>"
5
+
6
+LABEL org.label-schema.license=MIT \
7
+    org.label-schema.name=reel2bits-web \
8
+    org.label-schema.vcs-url=https://dev.sigpipe.me/dashie/reel2bits
9
+    org.label-schema.build-date=$DRONE_BUILD_STARTED \
10
+    org.label-schema.vcs-ref=$DRONE_COMMIT_SHA
11
+
12
+RUN mkdir -p /app /data /config
13
+WORKDIR /app
14
+
15
+ADD requirements.txt /app/
16
+RUN apk add --no-cache git libffi sox taglib libmagic tzdata libmad boost libsndfile libid3tag
17
+RUN pip install --no-cache-dir -r requirements.txt
18
+# Build audiowaveform
19
+RUN apk add --no-cache --virtual .build-deps \
20
+    cmake gcc g++ make pkgconfig git boost-dev gd-dev libmad-dev libsndfile-dev libid3tag-dev wget && \
21
+    git clone https://github.com/bbcrd/audiowaveform.git /tmp/audiowaveform && cd /tmp/audiowaveform && \
22
+    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 && \
23
+    ln -s googletest-release-1.8.0/googletest googletest && ln -s googletest-release-1.8.0/googlemock googlemock && \
24
+    mkdir build && cd build && cmake .. && make && cp audiowaveform /app/ && cd .. && rm -rf audiowaveform && \
25
+    apk del .build-deps
26
+
27
+ADD . /app/
28
+ADD entrypoint.sh /
29
+ADD config.py.sample /config/config.py
30
+
31
+VOLUME ["/data", "/config"]
32
+
33
+EXPOSE 5000
34
+
35
+ENTRYPOINT ["/entrypoint.sh"]
36
+
37
+CMD ["dramatiq", "workers.py", "-q", "upload_workflow"]

+ 4
- 0
entrypoint.sh View File

@@ -0,0 +1,4 @@
1
+#!/bin/sh
2
+set -e
3
+
4
+exec "$@"

Loading…
Cancel
Save