diff --git a/Dockerfile.perspective b/Dockerfile.perspective index b012699..8be9b5b 100644 --- a/Dockerfile.perspective +++ b/Dockerfile.perspective @@ -15,6 +15,10 @@ RUN poetry config virtualenvs.create false \ # Copy the entire project COPY . /app +# Set the API key as an environment variable +ARG PERSPECTIVE_API_KEY +ENV PERSPECTIVE_API_KEY=$PERSPECTIVE_API_KEY + # Expose the port the app runs on EXPOSE 8000 diff --git a/docker-compose.yml b/docker-compose.yml index 38b4afc..3becc16 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,8 @@ services: build: context: . dockerfile: Dockerfile.perspective + args: + - PERSPECTIVE_API_KEY=${PERSPECTIVE_API_KEY} image: perspective-ranker:latest environment: - PERSPECTIVE_API_KEY=${PERSPECTIVE_API_KEY} @@ -18,6 +20,8 @@ services: build: context: . dockerfile: Dockerfile.perspective + args: + - PERSPECTIVE_API_KEY=${PERSPECTIVE_API_KEY} environment: - PERSPECTIVE_API_KEY=${PERSPECTIVE_API_KEY} volumes: