Spaces:
Sleeping
Sleeping
FROM python:3.11.9-slim | |
# Expose the secret SECRETS at build-time | |
RUN --mount=type=secret,id=ORS_API_TOKEN,mode=0444,required=true | |
# Read secrets and set environment variables | |
RUN export MAPS_API_KEY=$(cat /run/secrets/ORS_API_TOKEN) \ | |
&& echo "MAPS_API_KEY=$MAPS_API_KEY" >> /etc/environment \ | |
# Source the environment file | |
RUN . /etc/environment | |
# Copy requirements file | |
COPY requirements.txt . | |
# Update pip | |
RUN pip --timeout=3000 install --no-cache-dir --upgrade pip | |
# Install dependecies | |
RUN pip --timeout=3000 install --no-cache-dir -r requirements.txt | |
# Make project directory | |
RUN mkdir -p /client/ | |
# Set working directory | |
WORKDIR /client | |
# Make cache directory cache directory | |
RUN mkdir -p /client/requests_cache/ | |
# Set the permissions | |
RUN chmod -R 777 /client/requests_cache | |
# Copy client frontend | |
COPY . . | |
# Set the permissions data directory | |
RUN chmod -R 777 /client/data | |
# Expose app port | |
EXPOSE 7860 | |
# Start application | |
CMD ["shiny", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"] |