2019-06-25 15:56:35 +02:00
|
|
|
IMAGE crisiscleanup 2.2.0-190620
|
|
|
|
META title Crisis Cleanup
|
|
|
|
META desc-cs Mapování následků katastrof
|
|
|
|
META desc-en Disaster relief mapping
|
|
|
|
META type app
|
|
|
|
META license GPL
|
|
|
|
META depends postgres
|
|
|
|
|
|
|
|
LAYER alpine3.8 3.8.4-190620
|
|
|
|
LAYER alpine3.8-ruby2.4 2.4.5-190620
|
|
|
|
LAYER alpine3.8-nodejs8 8.14.0-190620
|
2018-09-12 16:16:38 +02:00
|
|
|
|
2018-09-12 19:04:55 +02:00
|
|
|
FIXLAYER /usr/bin/fix-apk
|
2018-09-12 16:16:38 +02:00
|
|
|
|
|
|
|
ENV RAILS_ENV production
|
|
|
|
|
|
|
|
RUN EOF
|
|
|
|
# Install runtime dependencies
|
|
|
|
apk --no-cache add libpq tzdata
|
|
|
|
|
|
|
|
# Install build dependencies
|
|
|
|
apk --no-cache add --virtual .deps build-base git libxml2-dev libxslt-dev linux-headers npm postgresql-dev yarn zlib-dev
|
|
|
|
|
|
|
|
# Clone CrisisCleanup
|
2018-12-05 14:07:45 +01:00
|
|
|
git clone --depth 1 https://github.com/CrisisCleanup/crisiscleanup /srv/crisiscleanup
|
|
|
|
|
2019-02-26 20:24:02 +01:00
|
|
|
# Hackfix ruby dependency versions
|
2018-12-05 14:07:45 +01:00
|
|
|
sed -i 's/2\.4\.4/2.4.5/' /srv/crisiscleanup/Gemfile
|
2018-09-12 16:16:38 +02:00
|
|
|
|
|
|
|
# Install Ruby and NodeJS dependencies
|
|
|
|
cd /srv/crisiscleanup
|
|
|
|
bundle config build.nokogiri --use-system-libraries
|
|
|
|
bundle install
|
|
|
|
npm install
|
|
|
|
yarn
|
|
|
|
|
|
|
|
# Create CrisisCleanup secret
|
|
|
|
echo -e "production:\n secret_key_base: $(rake secret)" >/srv/crisiscleanup/config/secrets.yml
|
|
|
|
|
|
|
|
# Generate static resources
|
|
|
|
rake assets:precompile
|
|
|
|
|
|
|
|
# Create OS user
|
|
|
|
addgroup -S -g 8005 cc
|
|
|
|
adduser -S -u 8005 -h /srv/crisiscleanup -s /bin/false -g cc -G cc cc
|
|
|
|
chown -R cc:cc /srv/crisiscleanup
|
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
apk --no-cache del .deps
|
|
|
|
find /srv/crisiscleanup -name '.git*' -exec rm -rf {} +
|
|
|
|
rm -rf /usr/local/share/.cache
|
|
|
|
rm -rf /root/.bundle /root/.config /root/.npm
|
|
|
|
EOF
|
|
|
|
|
2018-09-14 18:13:11 +02:00
|
|
|
MOUNT DIR /srv/crisiscleanup/conf srv/crisiscleanup/config
|
2018-09-12 16:16:38 +02:00
|
|
|
|
|
|
|
USER 8005 8005
|
|
|
|
WORKDIR /srv/crisiscleanup
|
|
|
|
CMD rails server
|
2018-09-18 16:27:42 +02:00
|
|
|
HALT SIGTERM
|