Browse Source

Docker adjustments.

Stefano Cossu 4 years ago
parent
commit
20d9102627
4 changed files with 11 additions and 16 deletions
  1. 7 3
      Dockerfile
  2. 1 1
      bin/fcrepo
  3. 3 2
      docker-compose.yml
  4. 0 10
      docker/docker_entrypoint

+ 7 - 3
Dockerfile

@@ -2,14 +2,14 @@ FROM        python:3.7-alpine
 LABEL       "maintainer"="Michael B. Klein <michael.klein@northwestern.edu>" \
             "maintainer"="Stefano Cossu <scossu@getty.edu>"
 
-RUN         apk add --no-cache build-base
-RUN         apk add git
+RUN         apk add --no-cache build-base git
 RUN         pip3 install cython==0.29.6 cymem
 
 RUN         mkdir -p /data
 WORKDIR     /usr/local/lsup/src
 COPY        .git ./.git
 COPY        ext ./ext
+COPY        bin ./bin
 COPY        lakesuperior ./lakesuperior
 COPY        setup.py README.rst ./
 
@@ -17,6 +17,10 @@ RUN         git submodule update --init ext
 RUN         pip install -e .
 COPY        ./docker/etc ./lakesuperior/etc.defaults
 
+# Clean up build-required packages & dirs.
+RUN         apk del build-base git
+RUN         rm -rf .git
+
 RUN         [ -f /data/ldprs_store/data.mdb ] || \
                 echo yes | lsup-admin bootstrap
 
@@ -26,4 +30,4 @@ EXPOSE      8000
 
 ENTRYPOINT  ["gunicorn", "-c", "python:lakesuperior.wsgi", \
             "lakesuperior.server:fcrepo"]
-#ENTRYPOINT  ["/bin/sh"]
+#ENTRYPOINT  ["./bin/fcrepo"]

+ 1 - 1
bin/fcrepo

@@ -1,3 +1,3 @@
-#!/bin/bash
+#!/bin/sh
 
 gunicorn -c python:lakesuperior.wsgi lakesuperior.server:fcrepo

+ 3 - 2
docker-compose.yml

@@ -1,11 +1,12 @@
-version: '2'
+version: '3'
 
 volumes:
   lakesuperior:
 
 services:
   lakesuperior:
-    image: scossu/lakesuperior:stable
+    build:
+      context: .
     volumes:
       - lakesuperior:/data
     ports:

+ 0 - 10
docker/docker_entrypoint

@@ -1,10 +0,0 @@
-#!/bin/sh
-
-mkdir -p /data/log /data/run /data/bootstrap
-cp ./data/bootstrap/* /data/bootstrap
-pip install -e .
-coilmq &
-if [ ! -d /data/ldpnr_store ] && [ ! -d /data/ldprs_store ]; then
-  echo yes | lsup-admin bootstrap
-fi
-exec fcrepo