From d233db45d9d91992cee9db4d8ea0abaac12cb580 Mon Sep 17 00:00:00 2001 From: Aaron Job Date: Sun, 10 Sep 2023 10:31:15 +1000 Subject: [PATCH] added in docker and docker compose files --- Dockerfile | 15 +++++++++++++++ docker-compose.yml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..49434ff --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM python:3 + +WORKDIR /usr/src/app + +COPY requirements.txt ./ +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +RUN python -m venv pilot-env +RUN source pilot-env/bin/activate +RUN pip install -r requirements.txt +RUN python ./pilot/db_init.py + +CMD [ "python", "./pilot/main.py" ] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b8a54d6 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,34 @@ +version: '3' +services: + gpt-pilot: + environment: + - ENDPOINT=OPENAI + - OPENAI_API_KEY= + - MODEL_NAME=gpt-4 + - MAX_TOKENS=8192 + - DB_NAME=gpt-pilot + - DB_HOST=postgres + - DB_PORT=5432 + - DB_USER=gpt-pilot + - DB_PASSWORD=gpt-pilot + build: + context: . + dockerfile: Dockerfile + pgadmin: + container_name: pgadmin4_container + image: dpage/pgadmin4 + restart: always + environment: + PGADMIN_DEFAULT_EMAIL: admin@admin.com + PGADMIN_DEFAULT_PASSWORD: gpt-pilot + ports: + - "5050:80" + postgres: + image: postgres + restart: always + environment: + POSTGRES_USER: gpt-pilot + POSTGRES_PASSWORD: gpt-pilot + POSTGRES_DB: gpt-pilot + ports: + - "5432:5432"