Dockerfile 1015 Bytes
Newer Older
1 2 3
#
# Build Genesys server on top of jetty-alpine
#
Matija Obreza's avatar
Matija Obreza committed
4
FROM jetty:9.4.12
5 6 7

LABEL maintainer "Matija Obreza <matija.obreza@croptrust.org>"

Matija Obreza's avatar
Matija Obreza committed
8 9
USER root

Matija Obreza's avatar
Matija Obreza committed
10 11
ENV USER=jetty \
	GENESYS_DATA=/data/genesys \
Matija Obreza's avatar
Matija Obreza committed
12
	JETTY_BASE=/var/lib/jetty \
Matija Obreza's avatar
Matija Obreza committed
13
	GENESYS_WAR='genesys2-server*war'
14 15 16

WORKDIR ${JETTY_BASE}

Matija Obreza's avatar
Matija Obreza committed
17 18
# Update jetty configuration
COPY jetty ${JETTY_BASE}/
19

Matija Obreza's avatar
Matija Obreza committed
20
# Add war file to the setup
Matija Obreza's avatar
Matija Obreza committed
21
COPY ${GENESYS_WAR} ${JETTY_BASE}/webapps/genesys2-server.war
22

23
# Directories and permissions
Matija Obreza's avatar
Matija Obreza committed
24 25
RUN set -ex; \
		mkdir -p ${GENESYS_DATA} \
26 27 28
		&& chown ${USER}.${USER} ${GENESYS_DATA} \
		&& chmod go+r ${JETTY_BASE}/webapps/genesys2-server.war \
		&& chmod go+rwx ${GENESYS_DATA} \
Matija Obreza's avatar
Matija Obreza committed
29 30 31 32
# sh removes env vars it doesn't support (ones with periods)
#		&& find /docker-entrypoint.sh -name '*.sh' -exec ls -la {} \; \
		&& find /docker-entrypoint.sh -name '*.sh' -exec sed -ri 's|^#!/bin/sh$|#!/usr/bin/env bash|' {} \; \
#		&& cat /docker-entrypoint.sh \
Matija Obreza's avatar
Matija Obreza committed
33
		&& find ${JETTY_BASE} -type f -exec ls -la {} \;
34

Matija Obreza's avatar
Matija Obreza committed
35
# Exposed data volumes
36
VOLUME /data/genesys
Matija Obreza's avatar
Matija Obreza committed
37 38

USER jetty