forked from bb-Ricardo/netbox-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (22 loc) · 999 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM python:3.9-slim-bullseye
# Install dependencies
RUN apt-get update && apt-get -y upgrade && apt-get install -y git-core
# Run the application
WORKDIR /app
RUN set -eux; \
addgroup --gid 1000 netbox-sync; \
adduser --uid 1000 --ingroup netbox-sync --shell /bin/sh --home /home/netbox-sync --disabled-password \
--gecos "netbox-sync,0815,2342,9001" netbox-sync
# Prepare the application
COPY Dockerfile LICENSE.txt netbox-sync.py README.md requirements.txt settings-example.ini /app/
COPY module /app/module
RUN chown -R netbox-sync:netbox-sync /app
# disable upgrading setup tools due to bug in setuptools and automation sdk
# once this is fixed, switch back to: pip3 install --upgrade pip setuptools
RUN cd /app && \
pip3 install --upgrade pip && \
pip3 install wheel && \
pip3 install -r requirements.txt && \
pip3 install --upgrade git+https://github.com/vmware/vsphere-automation-sdk-python.git
USER netbox-sync
ENTRYPOINT ["python3", "netbox-sync.py"]