weather_api/Dockerfile
Argiris Deligiannidis dd79077a60
All checks were successful
continuous-integration/drone/push Build is passing
Add git to python-slim for docker image (CI)
2024-04-07 13:49:42 +03:00

28 lines
840 B
Docker

# Use the official Python base image
FROM python:3.11-slim-buster
# Set the working directory inside the container
WORKDIR /code
# Copy the requirements file to the working directory
COPY ./requirements.txt /code/requirements.txt
RUN apt-get update
RUN apt-get install -y git
# Install the Python dependencies
RUN pip config --user set global.progress_bar off
RUN pip install --no-cache-dir --prefer-binary -r /code/requirements.txt
# Copy the application code to the working directory
COPY ./*.py /code/
COPY ./table_data /code/table_data
COPY ./dot_env /code/.env
# Expose the port on which the application will run
EXPOSE 80
# Run the FastAPI application using uvicorn server
#CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
CMD ["uvicorn", "main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "80"]