Spaces:
Paused
Paused
Andrew Smith
commited on
Commit
·
43015c8
1
Parent(s):
6cf9bee
Move secret mounting further up
Browse files- Dockerfile +6 -4
Dockerfile
CHANGED
@@ -1,9 +1,15 @@
|
|
1 |
FROM python:3.10
|
2 |
|
|
|
|
|
|
|
|
|
3 |
# Set up a new user named "user" with user ID 1000
|
4 |
RUN useradd -m -u 1000 user
|
|
|
5 |
# Switch to the "user" user
|
6 |
USER user
|
|
|
7 |
# Set home to the user's home directory
|
8 |
ENV HOME=/home/user \
|
9 |
PATH=/home/user/.local/bin:$PATH
|
@@ -14,10 +20,6 @@ WORKDIR $HOME/app
|
|
14 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
15 |
COPY --chown=user . $HOME/app
|
16 |
|
17 |
-
# Get secret DB_URL and output it to /test at buildtime
|
18 |
-
RUN --mount=type=secret,id=DB_URL,mode=0444,required=true \
|
19 |
-
cat /run/secrets/DB_URL > /test
|
20 |
-
|
21 |
RUN pip install --no-cache-dir poetry
|
22 |
|
23 |
RUN poetry install --only main
|
|
|
1 |
FROM python:3.10
|
2 |
|
3 |
+
# Get secret DB_URL and output it to /test at buildtime
|
4 |
+
RUN --mount=type=secret,id=DB_URL,mode=0444,required=true \
|
5 |
+
cat /run/secrets/DB_URL > /test
|
6 |
+
|
7 |
# Set up a new user named "user" with user ID 1000
|
8 |
RUN useradd -m -u 1000 user
|
9 |
+
|
10 |
# Switch to the "user" user
|
11 |
USER user
|
12 |
+
|
13 |
# Set home to the user's home directory
|
14 |
ENV HOME=/home/user \
|
15 |
PATH=/home/user/.local/bin:$PATH
|
|
|
20 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
21 |
COPY --chown=user . $HOME/app
|
22 |
|
|
|
|
|
|
|
|
|
23 |
RUN pip install --no-cache-dir poetry
|
24 |
|
25 |
RUN poetry install --only main
|