fix: make sure container get's stopped once job is done

This commit is contained in:
Stephan Lüscher 2023-05-04 18:53:08 +00:00
parent 83379a0d72
commit 882340fa5c
No known key found for this signature in database
GPG key ID: 445779060FF3D3CF
3 changed files with 7 additions and 13 deletions

View file

@ -1,11 +1,7 @@
# Source Image
FROM docker.io/library/python:alpine3.17
# Install ansible setup project
# Install ansible and dependencies
WORKDIR /ansible
COPY ./ansible .
RUN pip3 install -r ./requirements.txt
RUN chmod +x ./startup.sh
# Container start command
CMD ["/ansible/startup.sh"]

View file

@ -1,7 +0,0 @@
#!/bin/sh
# Run setup only once
if [ ! -f /ansible/.startup-done ]; then
ansible-playbook main.yml
touch /ansible/.startup-done
fi