Spotter-VM/lxc-apps/crisiscleanup/lxcfile

48 lines
1.3 KiB
Plaintext
Raw Normal View History

2019-09-18 11:29:58 +02:00
IMAGE crisiscleanup_2.2.0-190620
2019-11-30 09:59:32 +01:00
FROM alpine3.8-ruby2.4_2.4.5-190620
2018-09-12 16:16:38 +02:00
ENV RAILS_ENV production
RUN EOF
# Install runtime dependencies
2019-11-30 09:59:32 +01:00
apk --no-cache add libpq nodejs tzdata
2018-09-12 16:16:38 +02:00
# 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
git clone --depth 1 https://github.com/CrisisCleanup/crisiscleanup /srv/crisiscleanup
# Hackfix ruby dependency versions
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 8080 cc
adduser -S -u 8080 -h /srv/crisiscleanup -s /bin/false -g cc -G cc cc
2018-09-12 16:16:38 +02:00
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
USER 8080 8080
2018-09-12 16:16:38 +02:00
WORKDIR /srv/crisiscleanup
CMD rails server
HALT SIGTERM