add minimal docker files for backend and database

This commit is contained in:
Andreas Koepf
2022-12-13 18:44:29 +01:00
parent 4774534262
commit 837452af25
3 changed files with 23 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
FROM python:3.9
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY ./app /code/app
COPY ./app /app
ENV PYTHONPATH=/app
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
+3
View File
@@ -0,0 +1,3 @@
FROM postgres:15
COPY ./scripts/create-db.sh /docker-entrypoint-initdb.d/
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
set -e
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE DATABASE ocgpt_backend;
EOSQL