view Dockerfile @ 309:0d2bdec1e637

Hint how to rebuild gemma inside Docker container
author Tom Gottfried <tom@intevation.de>
date Wed, 01 Aug 2018 16:53:31 +0200
parents e964c617265e
children 1a2dfd9351e9
line wrap: on
line source

FROM ubuntu:bionic
LABEL authors="tom.gottfried@intevation.de"

RUN sed -i 's/$/ universe/' /etc/apt/sources.list

RUN apt-get update &&\
    apt-get -y install --no-install-recommends \
            make git golang-go golang-github-gorilla-context-dev

WORKDIR /opt/gemma

# Copy only backend stuff
COPY 3rdpartylibs.sh ./
COPY auth ./auth/
COPY cmd ./cmd/
COPY config ./config/
COPY controllers ./controllers/
COPY Makefile ./

RUN make gemma && mkdir /opt/bin && mv cmd/gemma/gemma /opt/bin/

EXPOSE 8000

CMD ["/opt/bin/gemma",\
     "-H", "gemma_db",\
     "-o", "0.0.0.0",\
     "-s", "/tmp/gemma_session.data",\
     "-w", "./web"]

# Run with e.g.
# docker build -t gemma_backend .
# docker run --name gemma_backend -v $PWD:/opt/gemma -d -p 8200:8000 \
#            --link your_gemma_db:gemma_db gemma_backend
#
# To rebuild inside the container:
# ln -sf /opt/gemma/cmd/gemma/gemma /opt/bin/gemma
# make gemma