Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +14 -6
Dockerfile
CHANGED
@@ -47,16 +47,24 @@ COPY --from=builder /usr/local/bin /usr/local/bin
|
|
47 |
# Change ownership of the app directory to the user
|
48 |
RUN chown -R user:user $HOME/app
|
49 |
|
|
|
|
|
|
|
|
|
|
|
50 |
# Expose secrets at build time and store them in a file
|
51 |
RUN --mount=type=secret,id=AWS_ACCESS_KEY_ID,mode=0444,required=true \
|
52 |
-
|
53 |
-
|
|
|
54 |
RUN --mount=type=secret,id=AWS_SECRET_ACCESS_KEY,mode=0444,required=true \
|
55 |
-
|
56 |
-
|
|
|
57 |
RUN --mount=type=secret,id=AWS_DEFAULT_REGION,mode=0444,required=true \
|
58 |
-
|
59 |
-
|
|
|
60 |
# Source the AWS credentials
|
61 |
RUN . /app/aws_creds.sh
|
62 |
|
|
|
47 |
# Change ownership of the app directory to the user
|
48 |
RUN chown -R user:user $HOME/app
|
49 |
|
50 |
+
# Expose the secret SECRET_EXAMPLE at buildtime and use its value as git remote URL
|
51 |
+
RUN --mount=type=secret,id=SECRET_EXAMPLE,mode=0444,required=true \
|
52 |
+
git init && \
|
53 |
+
git remote add origin $(cat /run/secrets/SECRET_EXAMPLE)
|
54 |
+
|
55 |
# Expose secrets at build time and store them in a file
|
56 |
RUN --mount=type=secret,id=AWS_ACCESS_KEY_ID,mode=0444,required=true \
|
57 |
+
git init && \
|
58 |
+
git remote add origin $(cat /run/secrets/AWS_ACCESS_KEY_ID)
|
59 |
+
|
60 |
RUN --mount=type=secret,id=AWS_SECRET_ACCESS_KEY,mode=0444,required=true \
|
61 |
+
git init && \
|
62 |
+
git remote add origin $(cat /run/secrets/AWS_SECRET_ACCESS_KEY)
|
63 |
+
|
64 |
RUN --mount=type=secret,id=AWS_DEFAULT_REGION,mode=0444,required=true \
|
65 |
+
git init && \
|
66 |
+
git remote add origin $(cat /run/secrets/AWS_DEFAULT_REGION)
|
67 |
+
|
68 |
# Source the AWS credentials
|
69 |
RUN . /app/aws_creds.sh
|
70 |
|