Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build on Ubuntu 24.04 #399

Merged
merged 3 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/docker_2404.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build on Ubuntu 24.04

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build Docker images
uses: docker/build-push-action@v5
with:
file: docker/ubuntu/Dockerfile2404
load: true
tags: cgimap:2404
- name: Running Docker image
run: |
docker run --entrypoint /bin/bash cgimap:2404 -c "/usr/local/bin/openstreetmap-cgimap --help"
62 changes: 62 additions & 0 deletions docker/ubuntu/Dockerfile2404
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

2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void get_options(int argc, char **argv, po::variables_map &options) {
if (options.count("help")) {
std::cout << desc << std::endl;
output_backend_options(std::cout);
exit(1);
exit(0);
}

po::store(po::parse_environment(desc,
Expand Down