Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
introduce build stages to reduce build time
Browse files Browse the repository at this point in the history
  • Loading branch information
rush42 committed May 14, 2024
1 parent ef7b0fd commit ab19660
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
uses: actions/checkout@v3
- name: Build Image
run: |
docker compose build processing
docker build --target lua -f processing.Dockerfile -t testIMG .
- name: Run Tests
run: |
./run-tests.sh
docker run -v ./processing:/processing testIMG busted /processing/topics/ -p %.test%.lua$
33 changes: 19 additions & 14 deletions processing.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
FROM ubuntu:mantic
FROM ubuntu:mantic as lua

# Install Lua and "luarocks" – Lua package manager – https://luarocks.org/, https://packages.ubuntu.com/luarocks
RUN apt update && apt install -y lua5.3 liblua5.3-dev luarocks

# RUN luarocks install date
RUN luarocks install busted

# LUA Libaries:
# - "dkjson" used by parking.lua to write JSON for debugging
# RUN luarocks install dkjson
# TODO: We need to find a way to use those packages locally; otherwise using them does not make much sense
# - "inspect" https://github.com/kikito/inspect.lua
# (recommended in https://github.com/openstreetmap/osm2pgsql/blob/master/flex-config/README.md#dependencies)
# RUN luarocks install inspect
# - "date" https://luarocks.org/modules/tieske/date, https://github.com/Tieske/date

FROM lua as processing

ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Berlin
Expand All @@ -10,21 +27,9 @@ LABEL maintainer="FixMyCity - https://fixmycity.de"
# - /var/run/docker.sock:/var/run/docker.sock
COPY --from=docker:dind /usr/local/bin/docker /usr/local/bin/

# - "luarocks" – Lua package manager – https://luarocks.org/, https://packages.ubuntu.com/luarocks
RUN apt update && \
apt install -y osm2pgsql osmium-tool postgresql-client-15 tzdata wget libpq-dev curl lua5.3 liblua5.3-dev luarocks && \
apt install -y osm2pgsql osmium-tool postgresql-client-15 tzdata wget && \
apt upgrade -y
# LUA Libaries:
# - "dkjson" used by parking.lua to write JSON for debugging
# RUN luarocks install dkjson
# TODO: We need to find a way to use those packages locally; otherwise using them does not make much sense
# - "inspect" https://github.com/kikito/inspect.lua
# (recommended in https://github.com/openstreetmap/osm2pgsql/blob/master/flex-config/README.md#dependencies)
# RUN luarocks install inspect
# - "date" https://luarocks.org/modules/tieske/date, https://github.com/Tieske/date

# RUN luarocks install date
RUN luarocks install busted

# install node
RUN apt-get install -y nodejs npm
Expand Down

0 comments on commit ab19660

Please sign in to comment.