Skip to content

Commit

Permalink
Merge branch 'develop' into feat/tm_db
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Apr 23, 2024
2 parents 8280f22 + ec665eb commit 221cddd
Show file tree
Hide file tree
Showing 22 changed files with 489 additions and 320 deletions.
10 changes: 5 additions & 5 deletions compose/taginfo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ services:
context: ../images/taginfo
dockerfile: Dockerfile
ports:
- '4567:80'
- '8000:80'
volumes:
- ../data/taginfo-data:/apps/data/
- ../data/taginfo-data:/usr/src/app/data
command: >
/bin/bash -c "
./start.sh"
/bin/bash -c "/usr/src/app/start.sh web"
env_file:
- ../envs/.env.taginfo
- ../envs/.env.taginfo
76 changes: 50 additions & 26 deletions images/taginfo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
FROM ruby:2.4
ENV workdir /apps
FROM ruby:3.0-slim

ARG workdir=/usr/src/app
WORKDIR $workdir

RUN apt-get update && apt-get install -y \
curl \
sqlite3 \
sqlite3-pcre \
ruby-passenger \
libapache2-mod-passenger \
git \
cmake \
libbz2-dev \
libexpat1-dev \
Expand All @@ -18,32 +14,60 @@ RUN apt-get update && apt-get install -y \
libsqlite3-dev \
make \
zlib1g-dev \
curl \
sqlite3 \
sqlite3-pcre \
passenger \
libapache2-mod-passenger \
libreadline-dev \
tcl \
git \
jq \
ca-certificates \
osmium-tool \
pyosmium \
rsync \
tmux \
zsh \
nano \
vim \
&& rm -rf /var/lib/apt/lists/* # Clean up to reduce image size

# Clone and setup taginfo-tools
python3-pip \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/taginfo/taginfo-tools.git $workdir/taginfo-tools && \
cd $workdir/taginfo-tools && \
git submodule update --init && \
mkdir build && cd build && \
cmake .. && make
RUN gem install json rack-contrib puma sinatra:'<3' sinatra-r18n:'5.0.2'

# Install AWS CLI
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install && \
rm awscliv2.zip

# Clone and setup taginfo
RUN git clone https://github.com/taginfo/taginfo.git $workdir/taginfo && \
cd $workdir/taginfo && \
git checkout ae5a950f7aa4c0de4e706839619a1dc05fc4450a && \
echo "gem 'thin' " >> Gemfile && \
gem install bundler -v 2.3.27 && \
bundle install

COPY overwrite_config.py $workdir/
COPY start.sh $workdir/
CMD $workdir/start.sh
# Download and prepare uWSGI
RUN wget http://projects.unbit.it/downloads/uwsgi-latest.tar.gz \
&& tar zxvf uwsgi-latest.tar.gz \
&& rm uwsgi-latest.tar.gz && \
mv $(ls | grep uwsgi-) uwsgi-dir && \
cd uwsgi-dir && \
make PROFILE=nolang && \
PYTHON=python3 UWSGI_PROFILE_OVERRIDE="ssl=true,rack=true,http=true" make

# # Set non-root user
# RUN groupadd -r taginfo && useradd -m -r -g taginfo taginfo
# RUN chown -R taginfo:taginfo $workdir
# RUN chmod -R 777 $workdir
# USER taginfo

# RUN chown -R www-data: $workdir

WORKDIR $workdir

# Copy configuration files and scripts
COPY config/taginfo-config.json $workdir/
COPY start.sh .

# Expose port and set default command
EXPOSE 80
CMD ["./start.sh"]
75 changes: 75 additions & 0 deletions images/taginfo/config/taginfo-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"instance": {
"url": "http://localhost:80",
"name": "OpenStreetMap Taginfo",
"description": "This is a <b>taginfo test instance</b>. Change this text in your <tt>taginfo-config.json</tt>.",
"about": "<p>This site is maintained by osm-seed",
"icon": "/img/logo/test.png",
"contact": "[email protected]",
"area": "World",
"access_control_allow_origin": "*",
"sections": ["download", "taginfo"]
},
"geodistribution": {
"left": -180,
"bottom": -90,
"right": 180,
"top": 90,
"width": 360,
"height": 180,
"scale_image": 2,
"scale_compare_image" : 1,
"background_image": "/img/mapbg/world.png",
"image_attribution": "osm-seed"
},
"paths": {
"data_dir": "/usr/src/app/data",
"download_dir": "/usr/src/app/taginfo/web/public/download",
"bin_dir": "/usr/src/app/taginfo-tools/build/src",
"sqlite3_pcre_extension": "/usr/lib/sqlite3/pcre.so"
},
"xapi": {
"max_results": 1000,
"url_prefix": "https://overpass-api.de/api/xapi_meta?"
},
"turbo": {
"max_auto": 1000,
"url_prefix": "https://overpass-turbo.eu/?",
"wizard_area": "global"
},
"level0": {
"max_results": 50,
"overpass_url_prefix": "https://overpass-api.de/api/interpreter?",
"level0_url_prefix": "http://level0.osmz.ru/?"
},
"opensearch": {
"shortname": "Taginfo Test Instance",
"contact": "[email protected]",
"description": "Find metadata about OpenStreetMap tags",
"tags": "osm openstreetmap tag tags taginfo"
},
"sources": {
"download": "languages wiki wikidata",
"create": "db projects chronology",
"db": {
"planetfile": "/osm/planet/var/current-planet.osm.pbf",
"bindir": "/apps/data/update/build/src"
},
"chronology": {
"osm_history_file": "/osm/planet/var/current-history-planet.osh.pbf"
},
"master": {
"min_count_tags": 10,
"min_tag_combination_count": 10,
"min_count_for_map": 10,
"min_count_relations_per_type": 10
}
},
"logging": {
"directory": "/usr/src/app/logs",
"min_duration": 0.1
},
"tagstats": {
"geodistribution": "FlexMem"
}
}
45 changes: 0 additions & 45 deletions images/taginfo/overwrite_config.py

This file was deleted.

Loading

0 comments on commit 221cddd

Please sign in to comment.