Skip to content

Commit

Permalink
Add build on Ubuntu 24.04
Browse files Browse the repository at this point in the history
  • Loading branch information
mmd-osm committed Apr 22, 2024
1 parent 001dc8a commit 9920fdf
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/docker_2404.yml
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
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.74.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

0 comments on commit 9920fdf

Please sign in to comment.