feat: add Docker support

This commit is contained in:
Alex Wellnitz 2024-09-19 13:12:23 +02:00
parent f2cc7e59ac
commit 541a3c1ae7
3 changed files with 26 additions and 1 deletions

5
.dockerignore Normal file
View File

@ -0,0 +1,5 @@
profiles/
results/
__pycache__/
.venv/
tests/

19
Dockerfile Normal file
View File

@ -0,0 +1,19 @@
FROM simulationcraftorg/simc:latest
RUN apk add --no-cache python3 py3-pip git
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Install dependencies:
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8000
ENTRYPOINT []
CMD ["fastapi", "run", "main.py", "--port", "8000"]

View File

@ -12,7 +12,8 @@ from simcrunner.simc import HtmlExport
# SIMC Settings
logging.basicConfig(level=logging.INFO)
simc_path = os.path.join('tests', 'simc')
# simc_path = os.path.join('tests', 'simc')
simc_path = "./"
runner = Simc(simc_path=simc_path)
app = FastAPI()