mirror of
https://github.com/ublue-os/forge.git
synced 2025-04-23 06:53:44 +03:00
refactor: build custom container (#13)
use custom ansible version and install ansible collections during build process
This commit is contained in:
parent
12176c5718
commit
fe5f370ca3
|
@ -1,5 +1,22 @@
|
||||||
# Source Image
|
# Source Image
|
||||||
FROM docker.io/semaphoreui/semaphore:v2.8.90
|
FROM docker.io/library/python:alpine3.17
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN apk add openssh-client
|
||||||
|
|
||||||
|
# Install ansible-semaphore
|
||||||
|
ENV SEMAPHORE_VERSION="2.8.90"
|
||||||
|
WORKDIR /usr/local/bin
|
||||||
|
RUN wget https://github.com/ansible-semaphore/semaphore/releases/download/v${SEMAPHORE_VERSION}/semaphore_${SEMAPHORE_VERSION}_linux_amd64.tar.gz && \
|
||||||
|
tar xf ./semaphore_${SEMAPHORE_VERSION}_linux_amd64.tar.gz && \
|
||||||
|
chmod +x ./semaphore && \
|
||||||
|
wget https://raw.githubusercontent.com/ansible-semaphore/semaphore/v${SEMAPHORE_VERSION}/deployment/docker/common/semaphore-wrapper && \
|
||||||
|
chmod +x ./semaphore-wrapper
|
||||||
|
|
||||||
|
# Cleanup ansible-semaphore installation
|
||||||
|
RUN chown -R root:root . && \
|
||||||
|
rm ./semaphore_${SEMAPHORE_VERSION}_linux_amd64.tar.gz && \
|
||||||
|
mv ./LICENSE ./LICENSE_semaphore
|
||||||
|
|
||||||
# Environment variables
|
# Environment variables
|
||||||
ENV SEMAPHORE_DB_DIALECT="bolt"
|
ENV SEMAPHORE_DB_DIALECT="bolt"
|
||||||
|
@ -7,3 +24,12 @@ ENV SEMAPHORE_ADMIN_PASSWORD="ublue"
|
||||||
ENV SEMAPHORE_ADMIN_NAME="ublue"
|
ENV SEMAPHORE_ADMIN_NAME="ublue"
|
||||||
ENV SEMAPHORE_ADMIN_EMAIL="forge@ublue.local"
|
ENV SEMAPHORE_ADMIN_EMAIL="forge@ublue.local"
|
||||||
ENV SEMAPHORE_ADMIN="ublue"
|
ENV SEMAPHORE_ADMIN="ublue"
|
||||||
|
|
||||||
|
# Install ansible and dependencies
|
||||||
|
WORKDIR /srv/ublue
|
||||||
|
COPY ./ansible .
|
||||||
|
RUN pip3 install -r ./requirements_python.txt
|
||||||
|
RUN ansible-galaxy collection install -r ./requirements_ansible.yml
|
||||||
|
|
||||||
|
# Start ansible-semaphore
|
||||||
|
CMD ["/usr/local/bin/semaphore-wrapper","/usr/local/bin/semaphore","server","--config","/etc/semaphore/config.json"]
|
||||||
|
|
Loading…
Reference in a new issue