Restructuring build flows to choose user as default but be overridable

This commit is contained in:
2026-05-11 01:15:45 -05:00
parent 3fe59e9740
commit bfb1a8e95e
13 changed files with 276 additions and 38 deletions

View File

@@ -5,27 +5,24 @@
# FROM alpine:latest
# FROM python:3.12
# FROM debian:bookworm-slim
FROM nginx
FROM nginx:1.29
ARG USERNAME=itdominator
ARG UID=1000
ARG GID=1000
# 1. B: Set ENV Variables
ENV TERM=xterm-256color
# 2. Setup home user
RUN groupadd -g 1000 abaddon
RUN useradd -u 1000 -g 1000 -r -s /bin/false abaddon
COPY env/* /home/abaddon/
RUN mkdir -p /home/abaddon/Code
RUN mkdir -p /home/abaddon/Downloads
RUN mkdir -p /home/abaddon/LazyShare
RUN mkdir -p /home/abaddon/.local
RUN mkdir -p /home/abaddon/.config
RUN mkdir -p /home/abaddon/.cache
RUN mkdir -p /home/abaddon/.thumbnails
RUN chown abaddon:abaddon -R /home/abaddon
RUN groupadd -g ${GID} ${USERNAME}
RUN useradd -u ${UID} -g ${GID} -s /bin/bash -m ${USERNAME}
COPY env/* /home/${USERNAME}/
RUN /bin/bash -c 'mkdir -p /home/${USERNAME}/{Coding,Downloads,LazyShare,.local,.config,.cache,.thumbnails}'
RUN chown ${USERNAME}:${USERNAME} -R /home/${USERNAME}
# 3. A: Install dependencies
RUN apt-get update
RUN apt-get install -y \
RUN apt-get update && apt-get install -y \
--no-install-recommends \
--no-install-suggests \
pkg-config \
@@ -61,9 +58,9 @@ RUN apt-get install -y \
# 4. Copy files over
# 5. Cleanup
RUN apt-get autoremove --purge
RUN apt-get autoclean
RUN apt-get autoremove -y --purge && apt-get autoclean
RUN rm -rf /var/lib/apt/lists/*
RUN rm -rf /tmp/*
# 6. Expose Port and define the command used to run the app