-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Build on Ubuntu 24.04 | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build Docker images | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: docker/ubuntu/Dockerfile2404 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# vim:set ft=dockerfile: | ||
FROM ubuntu:24.04 AS builder | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update -qq && \ | ||
apt-get install -y gcc g++ make cmake \ | ||
libfcgi-dev libxml2-dev libmemcached-dev libbrotli-dev \ | ||
libboost-program-options-dev libcrypto++-dev libyajl-dev \ | ||
libpqxx-dev zlib1g-dev libfmt-dev \ | ||
postgresql-16 postgresql-server-dev-all \ | ||
--no-install-recommends && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /app | ||
|
||
# Copy the main application. | ||
COPY . ./ | ||
|
||
# Compile, install and remove source | ||
RUN mkdir build && cd build && \ | ||
CXXFLAGS="-Wall -Wextra -Wpedantic -Wno-unused-parameter" cmake .. -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release && \ | ||
make -j${nproc} && \ | ||
ctest --output-on-failure && \ | ||
strip openstreetmap-cgimap && \ | ||
cp openstreetmap-cgimap ../ | ||
|
||
FROM ubuntu:24.04 | ||
|
||
RUN apt-get update -qq && \ | ||
apt-get install -y \ | ||
libfcgi-bin libmemcached11 libboost-program-options1.83.0 \ | ||
libxml2 libcrypto++8 libyajl2 libpqxx-7.8t64 zlib1g libbrotli1 libfmt9 \ | ||
--no-install-recommends && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=builder /app/openstreetmap-cgimap /usr/local/bin | ||
|
||
RUN groupadd -g 61000 cgimap && \ | ||
useradd -g 61000 -l -M -s /bin/false -u 61000 cgimap | ||
|
||
USER cgimap | ||
|
||
ENV CGIMAP_HOST db | ||
ENV CGIMAP_DBNAME openstreetmap | ||
ENV CGIMAP_USERNAME openstreetmap | ||
ENV CGIMAP_PASSWORD openstreetmap | ||
ENV CGIMAP_MEMCACHE memcached | ||
ENV CGIMAP_RATELIMIT 204800 | ||
ENV CGIMAP_MAXDEBT 250 | ||
ENV CGIMAP_MODERATOR_RATELIMIT 1048576 | ||
ENV CGIMAP_MODERATOR_MAXDEBT 1024 | ||
ENV CGIMAP_PORT 8000 | ||
ENV CGIMAP_INSTANCES 10 | ||
|
||
EXPOSE 8000 | ||
|
||
ENTRYPOINT /usr/local/bin/openstreetmap-cgimap --pidfile /tmp/cgimap.pid --logfile=/proc/1/fd/1 --daemon && \ | ||
tail --pid=$(cat /tmp/cgimap.pid) -f /dev/null | ||
|