Skip to content

Instantly share code, notes, and snippets.

@kevinmelodi
Created September 13, 2023 02:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinmelodi/d7cdab518299062d5e7ca2170f432832 to your computer and use it in GitHub Desktop.
Save kevinmelodi/d7cdab518299062d5e7ca2170f432832 to your computer and use it in GitHub Desktop.
# You may need to specify the --platform depending on cloud provider
FROM --platform=linux/amd64 python:3.9
# Copy requirements first
COPY requirements.txt .
# Next, copy in the .env file, which contains the PRODIGY_KEY variable
COPY .env .
# Install everything
RUN python -m pip install --upgrade pip && \
python -m pip install -r requirements.txt && \
export $(cat .env) && \
python -m pip install prodigy -f https://####@download.prodi.gy && \
apt-get update && \
apt-get install -y poppler-utils
# Copy the rest in, keeping .dockerignore in mind
COPY . .
# Set some environment variables
ENV PRODIGY_LOGGING="VERBOSE"
ENV PRODIGY_BASIC_AUTH_USER=""
ENV PRODIGY_BASIC_AUTH_PASS=""
ENV GOOGLE_APPLICATION_CREDENTIALS="
ENV PRODIGY_ALLOWED_SESSIONS ""
# Copy the service account key into the container
RUN mkdir -p /app/secrets
COPY #### /app/secrets/
# Expose the port number appropriate for cloud vendor
EXPOSE 8080
CMD ["bash", "run.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment