File size: 963 Bytes
272c24a
e0f2892
 
272c24a
e0f2892
 
272c24a
e0f2892
 
272c24a
e0f2892
 
272c24a
d1cbc99
 
fbb28b7
 
272c24a
fbb28b7
 
 
 
 
 
 
f8419f4
272c24a
e0f2892
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
# Use Python 3.9 image as the base image
FROM python:3.9

# Set the working directory in the container to /code
WORKDIR /code

# Copy the requirements.txt file into the container at /code
COPY ./requirements.txt /code/requirements.txt

# Install the Python dependencies
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

# Copy the rest of your application's code into the container
COPY . .

# ...

# Initialize a Git repository and set up remotes with secrets
# Mount secrets for each remote
RUN --mount=type=secret,id=public_key,mode=0444,required=true git init && \
    git remote add remote1 $(cat /run/secrets/public_key)
RUN --mount=type=secret,id=private_key,mode=0444,required=true git remote add remote2 $(cat /run/secrets/private_key)
RUN --mount=type=secret,id=url_endpoint,mode=0444,required=true git remote add remote3 $(cat /run/secrets/url_endpoint)

# ...

# Specify the command to run on container start
CMD ["python", "app.py"]