Initial commit
This commit is contained in:
35
Dockerfile
Normal file
35
Dockerfile
Normal file
@@ -0,0 +1,35 @@
|
||||
# syntax=docker/dockerfile:1.4
|
||||
# Fast app image — gems come from deps base (custom/dalan-deps:1).
|
||||
# Rebuild deps when Gemfile.lock changes: docker build -f Dockerfile.deps -t custom/dalan-deps:1 .
|
||||
ARG DEPS_IMAGE=custom/dalan-deps:1
|
||||
FROM ${DEPS_IMAGE}
|
||||
|
||||
ARG MAXMINDDB_LINK
|
||||
ARG MAXMINDDB_LICENSE_KEY=T6ElPBlyOOuCyjzw
|
||||
ENV MAXMINDDB_LINK=${MAXMINDDB_LINK:-https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&suffix=tar.gz&license_key=${MAXMINDDB_LICENSE_KEY}} \
|
||||
RAILS_ENV=production \
|
||||
APP_HOME=/home/app
|
||||
|
||||
USER app
|
||||
WORKDIR $APP_HOME
|
||||
|
||||
COPY --chown=app:app . .
|
||||
|
||||
RUN mkdir -p ${APP_HOME}/geolite \
|
||||
&& (wget -qO ${APP_HOME}/geolite.tar.gz "${MAXMINDDB_LINK}" \
|
||||
&& tar xzf ${APP_HOME}/geolite.tar.gz -C ${APP_HOME}/geolite --strip-components 1 \
|
||||
&& rm ${APP_HOME}/geolite.tar.gz \
|
||||
|| echo "GeoLite download skipped — using placeholder") \
|
||||
&& test -f ${APP_HOME}/geolite/GeoLite2-Country.mmdb || touch ${APP_HOME}/geolite/GeoLite2-Country.mmdb
|
||||
|
||||
ENV BARONG_MAXMINDDB_PATH=${APP_HOME}/geolite/GeoLite2-Country.mmdb
|
||||
|
||||
RUN curl -fsSL https://www.cloudflare.com/ips-v4 >> ${APP_HOME}/config/cloudflare_ips.yml \
|
||||
&& echo "" >> ${APP_HOME}/config/cloudflare_ips.yml \
|
||||
&& curl -fsSL https://www.cloudflare.com/ips-v6 >> ${APP_HOME}/config/cloudflare_ips.yml
|
||||
|
||||
RUN ruby ./bin/init_config \
|
||||
&& bundle exec rake tmp:create
|
||||
|
||||
EXPOSE 8080
|
||||
CMD ["bundle", "exec", "puma", "--config", "config/puma.rb"]
|
||||
Reference in New Issue
Block a user