anas / Dockerfile
remainsalways's picture
Update Dockerfile
f685895 verified
raw
history blame contribute delete
848 Bytes
FROM debian:bullseye-slim
ENV DEBIAN_FRONTEND=noninteractive
# Install required packages
RUN apt-get update && apt-get install -y \
git \
ansible \
sshpass \
openssh-client \
sudo \
python3-pip \
curl \
nano \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Create user and working directory with proper permissions
RUN groupadd -g 1000 ansible && \
useradd -m -u 1000 -g ansible ansible && \
mkdir -p /ansible-nas && \
chown -R ansible:ansible /ansible-nas
USER ansible
WORKDIR /ansible-nas
# Clone Ansible-NAS and set up environment
RUN git clone https://github.com/davestephens/ansible-nas.git . && \
ansible-galaxy install -r requirements.yml
# Default command — override as needed on HF
CMD ["ansible-playbook", "-i", "inventories/my-ansible-nas/inventory", "nas.yml", "-b"]