-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
33 lines (23 loc) · 1.07 KB
/
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
31
32
33
FROM us-docker.pkg.dev/runwhen-nonprod-shared/public-images/codecollection-devtools:latest
USER root
ENV RUNWHEN_HOME=/home/runwhen
ENV PATH "$PATH:/usr/local/bin:/home/runwhen/.local/bin"
# Set up directories and permissions
RUN mkdir -p $RUNWHEN_HOME/codecollection
WORKDIR $RUNWHEN_HOME/codecollection
# Copy files into container with correct ownership
COPY --chown=runwhen:0 . .
# Check and install requirements if requirements.txt exists
RUN if [ -f "requirements.txt" ]; then pip install --no-cache-dir -r requirements.txt; else echo "requirements.txt not found, skipping pip install"; fi
# Install additional user packages
#RUN apt-get update && \
# apt-get install -y --no-install-recommends net-tools && \
# apt-get clean && \
# rm -rRUN az extension add --name application-insights
RUN az extension add --name application-insights
# Add runwhen user to sudoers with no password prompt
RUN echo "runwhen ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# Adjust permissions for runwhen user
RUN chown runwhen:0 -R $RUNWHEN_HOME/codecollection
# Switch to runwhen user
USER runwhen