Spaces:
Running
Running
File size: 1,139 Bytes
1623472 bf5abba 1623472 bf5abba 1623472 bf5abba bf8195e f33d183 9043487 9be2481 bf8195e 8149618 1623472 bf5abba |
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 29 30 31 32 33 34 35 36 37 38 39 |
FROM python:3.9
# Create a new user and group and set them as the default user
RUN groupadd -r appuser && useradd -r -g appuser appuser
# Set the working directory
WORKDIR /code
# Copy the requirements file and install dependencies
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Change ownership of the working directory
RUN chown -R appuser:appuser /code
# Switch to the new user
USER appuser
# Copy the rest of the application code
COPY . .
# Set the working directory to /code
WORKDIR /code
# Set the environment variable directly in the Dockerfile
ENV GH_TOKEN=${gh_token}
# Use a shell script to perform the git clone operation
RUN echo "export GH_TOKEN=${GH_TOKEN}" > clone_repo.sh && \
echo "git clone https://\${GH_TOKEN}@github.com/Eslam-Magdy-1297/ESearch_FletV01.git /code/ESearch_FletV01" >> clone_repo.sh && \
chmod +x clone_repo.sh && \
./clone_repo.sh
# Set the working directory to the cloned repository
WORKDIR /code/ESearch_FletV01
# Set the default command
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|