2018-03-16 18:31:34 +01:00
|
|
|
FROM ruby
|
2018-09-03 22:12:08 +02:00
|
|
|
LABEL maintainer="Disassembler <disassembler@dasm.cz>"
|
2018-03-16 18:31:34 +01:00
|
|
|
|
2018-03-17 20:49:36 +01:00
|
|
|
RUN \
|
|
|
|
# Install NodeJS runtime
|
2018-07-09 16:21:48 +02:00
|
|
|
apk --no-cache add nodejs
|
2018-03-17 20:49:36 +01:00
|
|
|
|
2018-03-16 18:31:34 +01:00
|
|
|
RUN \
|
|
|
|
# Install runtime dependencies
|
2018-04-30 22:57:50 +02:00
|
|
|
apk --no-cache add libpq
|
2018-03-16 18:31:34 +01:00
|
|
|
|
|
|
|
RUN \
|
2018-03-17 20:49:36 +01:00
|
|
|
# Install build dependencies for ODK Build
|
2018-07-09 16:21:48 +02:00
|
|
|
apk --no-cache add --virtual .deps build-base git linux-headers openjdk8-jre-base postgresql-dev \
|
2018-03-16 18:31:34 +01:00
|
|
|
# Clone ODK Build
|
2018-04-21 23:06:16 +02:00
|
|
|
&& git clone --depth 1 https://github.com/opendatakit/build /srv/opendatakit-build \
|
2018-03-16 18:31:34 +01:00
|
|
|
# Install Ruby dependencies
|
2018-04-21 23:06:16 +02:00
|
|
|
&& cd /srv/opendatakit-build \
|
2018-03-16 18:31:34 +01:00
|
|
|
&& bundle install --without test \
|
|
|
|
&& rake deploy:build \
|
|
|
|
# Create OS user
|
2018-03-17 16:13:16 +01:00
|
|
|
&& addgroup -S -g 8017 odkbuild \
|
2018-04-21 23:06:16 +02:00
|
|
|
&& adduser -S -u 8017 -h /srv/opendatakit-build -s /bin/false -g odkbuild -G odkbuild odkbuild \
|
|
|
|
&& chown -R odkbuild:odkbuild /srv/opendatakit-build \
|
2018-03-16 18:31:34 +01:00
|
|
|
# Cleanup
|
|
|
|
&& apk --no-cache del .deps \
|
2018-04-21 23:06:16 +02:00
|
|
|
&& find /srv/opendatakit-build -name '.git*' -exec rm -rf {} + \
|
2018-03-16 18:31:34 +01:00
|
|
|
&& rm -rf /root/.bundle
|
|
|
|
|
2018-03-17 20:49:36 +01:00
|
|
|
RUN \
|
|
|
|
# Install build dependencies for build2xlsform
|
2018-07-09 19:44:58 +02:00
|
|
|
apk --no-cache add --virtual .deps git make npm \
|
2018-03-17 20:49:36 +01:00
|
|
|
# Clone build2xlsform
|
|
|
|
&& git clone --depth 1 https://github.com/opendatakit/build2xlsform /srv/build2xlsform \
|
|
|
|
&& cd /srv/build2xlsform \
|
|
|
|
&& make \
|
|
|
|
# Change ownership
|
|
|
|
&& chown -R odkbuild:odkbuild /srv/build2xlsform \
|
|
|
|
# Cleanup
|
|
|
|
&& apk --no-cache del .deps \
|
|
|
|
&& find /srv/build2xlsform -name '.git*' -exec rm -rf {} + \
|
|
|
|
&& rm -rf /root/.config /root/.npm
|
|
|
|
|
|
|
|
COPY docker/ /
|
|
|
|
|
2018-03-25 23:16:06 +02:00
|
|
|
EXPOSE 8080
|
2018-03-16 18:31:34 +01:00
|
|
|
|
2018-03-17 20:49:36 +01:00
|
|
|
CMD ["s6-svscan", "/etc/services.d"]
|