SharathReddy commited on
Commit
773ac8b
·
verified ·
1 Parent(s): e3b6ed3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -6
Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
  # 1. Start with a stable base image
2
  FROM python:3.10.13-slim-bullseye
3
 
4
- # 2. Set environment variables
5
  ENV DEBIAN_FRONTEND=noninteractive
6
  ENV PYTHONUNBUFFERED=1
7
 
@@ -9,13 +9,13 @@ ENV PYTHONUNBUFFERED=1
9
  RUN apt-get update && apt-get install -y --no-install-recommends git && \
10
  apt-get clean && rm -rf /var/lib/apt/lists/*
11
 
12
- # 4. Create a non-root user and the application directory
13
  RUN useradd -m -u 1000 user
14
- WORKDIR /home/user/app
15
 
16
- # 5. Copy files and set ownership for the non-root user
17
- COPY --chown=user:user ./requirements.txt ./requirements.txt
18
- COPY --chown=user:user ./mine_diffs.py ./mine_diffs.py
19
 
20
  # 6. Switch to the non-root user
21
  USER user
 
1
  # 1. Start with a stable base image
2
  FROM python:3.10.13-slim-bullseye
3
 
4
+ # 2. Set environment variables to prevent interactive prompts
5
  ENV DEBIAN_FRONTEND=noninteractive
6
  ENV PYTHONUNBUFFERED=1
7
 
 
9
  RUN apt-get update && apt-get install -y --no-install-recommends git && \
10
  apt-get clean && rm -rf /var/lib/apt/lists/*
11
 
12
+ # 4. Create a non-root user and set the working directory in its home
13
  RUN useradd -m -u 1000 user
14
+ WORKDIR /home/user/code
15
 
16
+ # 5. Copy your files and give ownership to the new user
17
+ COPY --chown=user:user ./requirements.txt .
18
+ COPY --chown=user:user ./mine_diffs.py .
19
 
20
  # 6. Switch to the non-root user
21
  USER user