view Dockerfile @ 378:88aa790d1437

Do not assume existance of a specific database in setup In case the invoking database user has no database of the same name, we can just use the database we want to create anyhow.
author Tom Gottfried <tom@intevation.de>
date Fri, 10 Aug 2018 13:42:51 +0200
parents 6d145ee0a097
children 20d2edbc863d
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 misc ./misc/
COPY Makefile ./
COPY example_conf.toml ./

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

EXPOSE 8000

CMD ["/opt/bin/gemma", "-c", "/opt/gemma/example_conf.toml"]

# 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