Created
June 28, 2021 00:03
-
-
Save nbertagnolli/192ac0aaf801640bdf8af7da4ea7c95a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.8 | |
# Setup the api directory for your project code | |
RUN mkdir /api | |
COPY . /api | |
COPY requirements.txt /api | |
WORKDIR /api | |
# Install all necessary libraries into a pyenv environment | |
RUN python3 -m venv /api.venv | |
RUN . /api.venv/bin/activate && pip install -r requirements.txt | |
# Expose our access port | |
EXPOSE 8000 | |
# Run the server in our pyenv environment | |
CMD . /api.venv/bin/activate && exec uvicorn server:app --host 0.0.0.0 --port 8000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment