Sean-Case commited on
Commit
55b0541
1 Parent(s): d99f440

edited Dockerfile slightly

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -1
Dockerfile CHANGED
@@ -1,4 +1,5 @@
1
- FROM public.ecr.aws/docker/library/python:3.10.13-slim as build
 
2
 
3
  WORKDIR /src
4
 
@@ -6,10 +7,15 @@ COPY requirements.txt .
6
 
7
  RUN pip install --no-cache-dir -r requirements.txt
8
 
 
 
 
9
  # Set up a new user named "user" with user ID 1000
10
  RUN useradd -m -u 1000 user
 
11
  # Switch to the "user" user
12
  USER user
 
13
  # Set home to the user's home directory
14
  ENV HOME=/home/user \
15
  PATH=/home/user/.local/bin:$PATH \
 
1
+ # First stage: build dependencies
2
+ FROM public.ecr.aws/docker/library/python:3.10.13-slim AS build
3
 
4
  WORKDIR /src
5
 
 
7
 
8
  RUN pip install --no-cache-dir -r requirements.txt
9
 
10
+ # Second stage: final image
11
+ FROM build AS final
12
+
13
  # Set up a new user named "user" with user ID 1000
14
  RUN useradd -m -u 1000 user
15
+
16
  # Switch to the "user" user
17
  USER user
18
+
19
  # Set home to the user's home directory
20
  ENV HOME=/home/user \
21
  PATH=/home/user/.local/bin:$PATH \