-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (26 loc) · 1.13 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM redmine:5.1-bookworm
# Install required packages
RUN apt update && apt install -y gcc make supervisor
# Copy Gemfile for your plugin
COPY ./Gemfile /usr/src/redmine/plugins/redmine_ai_summary/Gemfile
RUN bundle install --with=development
# Set up SQLite database
RUN echo "development:\n adapter: sqlite3\n database: /usr/src/redmine/sqlite/redmine.db" > /usr/src/redmine/config/database.yml
RUN mkdir -p /usr/src/redmine/sqlite && chown -R 999:999 /usr/src/redmine/sqlite
# Adjust Rails environment settings
RUN sed -i '/^end$/i config.hosts.clear' /usr/src/redmine/config/environments/development.rb
# Copy custom rake task
COPY lib/tasks/create_test_data.rake lib/tasks/
COPY lib/tasks/set_admin_password.rake lib/tasks/
# Switch working directory
WORKDIR /usr/src/redmine
# Set up the entrypoint and commands
CMD ["/bin/bash", "-c", " \
export RAILS_ENV=development && \
bundle install && \
rails db:migrate && \
rails redmine:plugins:migrate && \
echo 'en' | rails redmine:load_default_data && \
rails redmine:create_test_data && \
rails redmine:set_admin_password && \
rails server -e development -b 0.0.0.0"]