Skip to content

Commit

Permalink
port corrected for service
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurrawte committed Jun 30, 2023
1 parent 18bbc0f commit 1e41ccf
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,26 @@ FROM python:3.10-slim-buster
WORKDIR /app

# Copy the current directory contents into the container at /app
ADD . /app
COPY . /app

# Update and install system libraries
RUN apt-get update && apt-get install -y \
ghostscript \
--no-install-recommends && \
rm -rf /var/lib/apt/lists/*


# Install Poetry
RUN pip install poetry

# Install project dependencies
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi

# Make port 80 available to the world outside this container
EXPOSE 8000
# Set the default port as an environment variable
ENV PORT=8000

# Expose the port defined by the environment variable
EXPOSE $PORT

# Run app.py when the container launches
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
# Run the uvicorn command with the PORT environment variable
CMD uvicorn main:app --host 0.0.0.0 --port $PORT

0 comments on commit 1e41ccf

Please sign in to comment.