diff --git a/images/taginfo/Dockerfile b/images/taginfo/Dockerfile index 16745806..d092af15 100644 --- a/images/taginfo/Dockerfile +++ b/images/taginfo/Dockerfile @@ -1,25 +1,17 @@ +# Use a specific version of the ruby image for better reproducibility FROM ruby:3.0 -ENV workdir /apps -# Install Taginfo site -RUN apt-get update && apt-get -y install \ +# Set the working directory +WORKDIR /apps + +# Update and install dependencies in a single layer to reduce image size +RUN apt-get update && apt-get install -y \ curl \ sqlite3 \ sqlite3-pcre \ ruby-passenger \ libapache2-mod-passenger \ - git - -# Commit ae5a950f7aa4c0de4e706839619a1dc05fc4450a, at 2021-10-18 -RUN git clone https://github.com/taginfo/taginfo.git $workdir/taginfo -WORKDIR $workdir/taginfo -RUN git checkout ae5a950f7aa4c0de4e706839619a1dc05fc4450a -RUN echo "gem 'thin' " >>Gemfile -RUN gem install bundler -RUN bundle install - -# Install Taginfo tools -RUN apt-get -y install \ + git \ cmake \ libbz2-dev \ libexpat1-dev \ @@ -31,25 +23,34 @@ RUN apt-get -y install \ make \ zlib1g-dev \ jq \ - ca-certificates - -# Other useful packages -RUN apt-get install -y \ - git \ + ca-certificates \ osmium-tool \ pyosmium \ rsync \ tmux \ - zsh + zsh \ + nano \ + vim \ + && rm -rf /var/lib/apt/lists/* + +# Clone and set up Taginfo +RUN git clone https://github.com/taginfo/taginfo.git taginfo \ + && cd taginfo \ + # && echo "gem 'thin'" >> Gemfile \ + && gem install bundler \ + && bundle install -RUN git clone https://github.com/taginfo/taginfo-tools.git $workdir/taginfo-tools -WORKDIR $workdir/taginfo-tools -RUN git submodule update --init -RUN mkdir build && cd build && cmake .. && make +# Clone and set up Taginfo tools +RUN git clone https://github.com/taginfo/taginfo-tools.git taginfo-tools \ + && cd taginfo-tools \ + && git submodule update --init \ + && mkdir build \ + && cd build \ + && cmake .. \ + && make -RUN apt-get install -y nano vim -COPY overwrite_config.py $workdir/ -COPY start.sh $workdir/ +# Copy necessary files +COPY overwrite_config.py start.sh ./ -WORKDIR $workdir/ -CMD $workdir/start.sh \ No newline at end of file +# Set the command to start the application +CMD ["./start.sh"] diff --git a/images/taginfo/start.sh b/images/taginfo/start.sh index 37a50f02..0d79c50a 100755 --- a/images/taginfo/start.sh +++ b/images/taginfo/start.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -xe WORKDIR=/apps DATA_DIR=$WORKDIR/data