Migrate from docker to podman (compose)

As this is rootless, daemonless and can be maintained via home manager
instead of system.
This commit is contained in:
Daniel Siepmann 2023-06-14 07:34:06 +02:00
parent 34784bf81c
commit 3b1bf7f698
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
4 changed files with 29 additions and 19 deletions

8
composes/readme.rst Normal file
View file

@ -0,0 +1,8 @@
Contains my own `compose.yaml` files for different projects.
Nothing fancy, but some of our customer projects include Solr or Elasticsearch.
TYPO3 Extension EXT:solr provides ready to use docker images for each version.
We can easily use them with compose and limit resource usage of Java, e.g. to 2 GB.
That's fine for local development.
I collect all the files here in the folder and symlink them to the projects,
just like the shell.nix files.

13
composes/soziopolis.yaml Normal file
View file

@ -0,0 +1,13 @@
---
# Do not use version 3 as we don't have mem_limit available
version: '2.2'
services:
solr:
image: docker.io/typo3solr/ext-solr:11.5.1
mem_limit: '2GB'
volumes:
- solr-soziopolis:/var/solr/data/data
ports:
- "127.0.0.1:8983:8983"
volumes:
solr-soziopolis:

View file

@ -36,7 +36,9 @@ with pkgs; [
kcachegrind
geckodriver
docker-compose
podman-compose
# Dependencies of podman-compose
podman
# In order to pull binaries from their.
# E.g. phps: https://github.com/fossar/nix-phps#how-to-use

View file

@ -113,7 +113,7 @@ in writeShellApplication {
tmux send-keys C-l
# Missing C-m at end, because we don't want to submit.
# We often don't need solr running to do our job.
tmux send-keys -t "$session:$windowId" "docker-compose run --rm --service-ports solr"
tmux send-keys -t "$session:$windowId" "podman-compose run --rm --service-ports solr"
(( "windowId+=1" ))
fi
@ -126,33 +126,20 @@ in writeShellApplication {
tmux send-keys C-l
# Missing C-m at end, because we don't want to submit.
# We often don't need oraproxy running to do our job.
tmux send-keys -t "$session:$windowId" "docker-compose run --rm --service-ports oraproxy"
tmux send-keys -t "$session:$windowId" "podman-compose run --rm --service-ports oraproxy"
(( "windowId+=1" ))
fi
# Start elastic container
if [ -d "$projectRoot/elastic/" ]; then
elasticPath="$projectRoot/elastic/"
if [ -d "$projectRoot/elasticsearch/" ]; then
elasticPath="$projectRoot/elasticsearch/"
tmux new-window -n docker -t "$session"
tmux send-keys -t "$session:$windowId" "cd $elasticPath" C-m
tmux send-keys C-l
# Missing C-m at end, because we don't want to submit.
# We often don't need elastic running to do our job.
tmux send-keys -t "$session:$windowId" "docker-compose run --rm --service-ports elastic"
(( "windowId+=1" ))
fi
# Start mongodb container
if [ -d "$projectRoot/mongodb/" ]; then
mongodbPath="$projectRoot/mongodb/"
tmux new-window -n docker -t "$session"
tmux send-keys -t "$session:$windowId" "cd $mongodbPath" C-m
tmux send-keys C-l
# Missing C-m at end, because we don't want to submit.
# We often don't need mongodb running to do our job.
tmux send-keys -t "$session:$windowId" "docker-compose run --rm --service-ports mongodb"
tmux send-keys -t "$session:$windowId" "podman-compose run --rm --service-ports elasticsearch"
(( "windowId+=1" ))
fi