Restructuring build flows to choose user as default but be overridable
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
# 1. A: Define a base image
|
||||
FROM itdominator-base
|
||||
|
||||
ARG USERNAME=itdominator
|
||||
|
||||
# 1. B: Set ENV Variables
|
||||
ENV NVM_VERSION=0.40.3
|
||||
ENV NODE_VERSION=24.9.0
|
||||
@@ -18,7 +20,7 @@ ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# 2. Set the working directory inside the container
|
||||
WORKDIR /home/abaddon/
|
||||
WORKDIR /home/${USERNAME}
|
||||
|
||||
# 3. A: Install dependencies
|
||||
RUN apt-get update
|
||||
@@ -42,10 +44,10 @@ RUN npm --version
|
||||
COPY Docker/opt/ /opt/
|
||||
|
||||
COPY Docker/scripts/run.sh .
|
||||
RUN chmod +x /home/abaddon/run.sh
|
||||
RUN chown abaddon:abaddon -R /home/abaddon
|
||||
RUN chmod +x /home/${USERNAME}/run.sh
|
||||
RUN chown ${USERNAME}:${USERNAME} -R /home/${USERNAME}
|
||||
|
||||
USER abaddon
|
||||
USER ${USERNAME}
|
||||
RUN ollama serve & sleep 5 && ollama pull llama3.1:8b
|
||||
USER root
|
||||
|
||||
@@ -58,4 +60,4 @@ RUN rm -rf /tmp/*
|
||||
RUN mkdir -p /tmp/apps
|
||||
|
||||
# 6. Expose Port and define the command used to run the app
|
||||
CMD ["/home/abaddon/run.sh"]
|
||||
CMD ["/home/itdominator/run.sh"]
|
||||
|
||||
Reference in New Issue
Block a user