mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Split docker files
This commit is contained in:
parent
1b6273ba1c
commit
c13ebe8d3c
8 changed files with 81 additions and 20 deletions
|
|
@ -1 +1 @@
|
||||||
0.21.6
|
0.22.0
|
||||||
|
|
|
||||||
2
.github/workflows/build_and_push.yml
vendored
2
.github/workflows/build_and_push.yml
vendored
|
|
@ -40,7 +40,7 @@ jobs:
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./docker/Dockerfile
|
file: ./docker/Dockerfile.dev
|
||||||
push: true
|
push: true
|
||||||
tags: freikin/dawarich:latest,freikin/dawarich:${{ github.event.inputs.branch || github.ref_name }}
|
tags: freikin/dawarich:latest,freikin/dawarich:${{ github.event.inputs.branch || github.ref_name }}
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
|
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
|
||||||
|
|
|
||||||
22
CHANGELOG.md
22
CHANGELOG.md
|
|
@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
# 0.22.0 - 2025-01-09
|
||||||
|
|
||||||
|
⚠️ This release introduces a breaking change. ⚠️
|
||||||
|
|
||||||
|
Please read this release notes carefully before upgrading.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- All docker-related files were moved to the `docker` directory.
|
||||||
|
- Default memory limit for `dawarich_app` and `dawarich_sidekiq` services was increased to 4GB.
|
||||||
|
- `dawarich_app` and `dawarich_sidekiq` services now use separate entrypoint scripts.
|
||||||
|
- Gems (dependency libraries) are now being shipped as part of the Dawarich Docker image.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Visit suggesting job does nothing if user has no tracked points.
|
||||||
|
- `BulkStatsCalculationJob` now being called without arguments in the data migration.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- A proper production Dockerfile, docker-compose and env files.
|
||||||
|
|
||||||
# 0.21.6 - 2025-01-07
|
# 0.21.6 - 2025-01-07
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
||||||
|
|
@ -20,4 +20,3 @@ test:
|
||||||
production:
|
production:
|
||||||
<<: *default
|
<<: *default
|
||||||
database: <%= ENV['DATABASE_NAME'] || 'dawarich_production' %>
|
database: <%= ENV['DATABASE_NAME'] || 'dawarich_production' %>
|
||||||
# url: <%= ENV['DATABASE_URL'] %>
|
|
||||||
|
|
|
||||||
50
docker/Dockerfile.dev
Normal file
50
docker/Dockerfile.dev
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
FROM ruby:3.3.4-alpine
|
||||||
|
|
||||||
|
ENV APP_PATH=/var/app
|
||||||
|
ENV BUNDLE_VERSION=2.5.21
|
||||||
|
ENV BUNDLE_PATH=/usr/local/bundle/gems
|
||||||
|
ENV RAILS_LOG_TO_STDOUT=true
|
||||||
|
ENV RAILS_PORT=3000
|
||||||
|
|
||||||
|
# Install dependencies for application
|
||||||
|
RUN apk -U add --no-cache \
|
||||||
|
build-base \
|
||||||
|
git \
|
||||||
|
postgresql-dev \
|
||||||
|
postgresql-client \
|
||||||
|
libxml2-dev \
|
||||||
|
libxslt-dev \
|
||||||
|
nodejs \
|
||||||
|
yarn \
|
||||||
|
imagemagick \
|
||||||
|
tzdata \
|
||||||
|
less \
|
||||||
|
yaml-dev \
|
||||||
|
gcompat \
|
||||||
|
&& mkdir -p $APP_PATH
|
||||||
|
|
||||||
|
# Update gem system and install bundler
|
||||||
|
RUN gem update --system 3.6.2 \
|
||||||
|
&& gem install bundler --version "$BUNDLE_VERSION" \
|
||||||
|
&& rm -rf $GEM_HOME/cache/*
|
||||||
|
|
||||||
|
WORKDIR $APP_PATH
|
||||||
|
|
||||||
|
COPY ../Gemfile ../Gemfile.lock ../vendor ../.ruby-version ./
|
||||||
|
|
||||||
|
# Install all gems including development and test
|
||||||
|
RUN bundle config set --local path 'vendor/bundle' \
|
||||||
|
&& bundle install --jobs 4 --retry 3
|
||||||
|
|
||||||
|
COPY ../. ./
|
||||||
|
|
||||||
|
# Copy entrypoint scripts and grant execution permissions
|
||||||
|
COPY ./docker/web-entrypoint.sh /usr/local/bin/web-entrypoint.sh
|
||||||
|
RUN chmod +x /usr/local/bin/web-entrypoint.sh
|
||||||
|
|
||||||
|
COPY ./docker/sidekiq-entrypoint.sh /usr/local/bin/sidekiq-entrypoint.sh
|
||||||
|
RUN chmod +x /usr/local/bin/sidekiq-entrypoint.sh
|
||||||
|
|
||||||
|
EXPOSE $RAILS_PORT
|
||||||
|
|
||||||
|
ENTRYPOINT [ "bundle", "exec" ]
|
||||||
|
|
@ -5,6 +5,7 @@ ENV BUNDLE_VERSION=2.5.21
|
||||||
ENV BUNDLE_PATH=/usr/local/bundle/gems
|
ENV BUNDLE_PATH=/usr/local/bundle/gems
|
||||||
ENV RAILS_LOG_TO_STDOUT=true
|
ENV RAILS_LOG_TO_STDOUT=true
|
||||||
ENV RAILS_PORT=3000
|
ENV RAILS_PORT=3000
|
||||||
|
ENV RAILS_ENV=production
|
||||||
|
|
||||||
# Install dependencies for application
|
# Install dependencies for application
|
||||||
RUN apk -U add --no-cache \
|
RUN apk -U add --no-cache \
|
||||||
|
|
@ -28,26 +29,19 @@ RUN gem update --system 3.6.2 \
|
||||||
&& gem install bundler --version "$BUNDLE_VERSION" \
|
&& gem install bundler --version "$BUNDLE_VERSION" \
|
||||||
&& rm -rf $GEM_HOME/cache/*
|
&& rm -rf $GEM_HOME/cache/*
|
||||||
|
|
||||||
# Navigate to app directory
|
|
||||||
WORKDIR $APP_PATH
|
WORKDIR $APP_PATH
|
||||||
|
|
||||||
COPY ../Gemfile ../Gemfile.lock ../vendor ../.ruby-version ./
|
COPY ../Gemfile ../Gemfile.lock ../vendor ../.ruby-version ./
|
||||||
|
|
||||||
# Install missing gems
|
# Install production gems only
|
||||||
RUN bundle config set --local path 'vendor/bundle' \
|
RUN bundle config set --local path 'vendor/bundle' \
|
||||||
&& if [ "$RAILS_ENV" = "production" ]; then \
|
&& bundle install --jobs 4 --retry 3 --without development test
|
||||||
bundle install --jobs 4 --retry 3 --without development test; \
|
|
||||||
else \
|
|
||||||
bundle install --jobs 4 --retry 3; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
COPY ../. ./
|
COPY ../. ./
|
||||||
|
|
||||||
# Precompile assets for production
|
# Precompile assets for production
|
||||||
RUN if [ "$RAILS_ENV" = "production" ]; then \
|
RUN bundle exec rake assets:precompile \
|
||||||
bundle exec rake assets:precompile \
|
&& rm -rf node_modules tmp/cache
|
||||||
&& rm -rf node_modules tmp/cache; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Copy entrypoint scripts and grant execution permissions
|
# Copy entrypoint scripts and grant execution permissions
|
||||||
COPY ./docker/web-entrypoint.sh /usr/local/bin/web-entrypoint.sh
|
COPY ./docker/web-entrypoint.sh /usr/local/bin/web-entrypoint.sh
|
||||||
|
|
@ -65,8 +65,6 @@ services:
|
||||||
TIME_ZONE: Europe/London
|
TIME_ZONE: Europe/London
|
||||||
APPLICATION_PROTOCOL: http
|
APPLICATION_PROTOCOL: http
|
||||||
DISTANCE_UNIT: km
|
DISTANCE_UNIT: km
|
||||||
PHOTON_API_HOST: photon.komoot.io
|
|
||||||
PHOTON_API_USE_HTTPS: true
|
|
||||||
PROMETHEUS_EXPORTER_ENABLED: false
|
PROMETHEUS_EXPORTER_ENABLED: false
|
||||||
PROMETHEUS_EXPORTER_HOST: 0.0.0.0
|
PROMETHEUS_EXPORTER_HOST: 0.0.0.0
|
||||||
PROMETHEUS_EXPORTER_PORT: 9394
|
PROMETHEUS_EXPORTER_PORT: 9394
|
||||||
|
|
@ -121,8 +119,6 @@ services:
|
||||||
BACKGROUND_PROCESSING_CONCURRENCY: 10
|
BACKGROUND_PROCESSING_CONCURRENCY: 10
|
||||||
APPLICATION_PROTOCOL: http
|
APPLICATION_PROTOCOL: http
|
||||||
DISTANCE_UNIT: km
|
DISTANCE_UNIT: km
|
||||||
PHOTON_API_HOST: photon.komoot.io
|
|
||||||
PHOTON_API_USE_HTTPS: true
|
|
||||||
PROMETHEUS_EXPORTER_ENABLED: false
|
PROMETHEUS_EXPORTER_ENABLED: false
|
||||||
PROMETHEUS_EXPORTER_HOST: dawarich_app
|
PROMETHEUS_EXPORTER_HOST: dawarich_app
|
||||||
PROMETHEUS_EXPORTER_PORT: 9394
|
PROMETHEUS_EXPORTER_PORT: 9394
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ services:
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpus: '0.50' # Limit CPU usage to 50% of one core
|
cpus: '0.50' # Limit CPU usage to 50% of one core
|
||||||
memory: '2G' # Limit memory usage to 2GB
|
memory: '4G' # Limit memory usage to 4GB
|
||||||
dawarich_sidekiq:
|
dawarich_sidekiq:
|
||||||
image: dawarich:prod
|
image: dawarich:prod
|
||||||
container_name: dawarich_sidekiq
|
container_name: dawarich_sidekiq
|
||||||
|
|
@ -147,7 +147,7 @@ services:
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpus: '0.50' # Limit CPU usage to 50% of one core
|
cpus: '0.50' # Limit CPU usage to 50% of one core
|
||||||
memory: '2G' # Limit memory usage to 2GB
|
memory: '4G' # Limit memory usage to 4GB
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
dawarich_db_data:
|
dawarich_db_data:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue