mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2026-02-23 15:49:50 +01:00
wired up dockr compose and ttyd
This commit is contained in:
25
Dockerfile
25
Dockerfile
@@ -1,15 +1,22 @@
|
|||||||
FROM python:3
|
FROM python:3
|
||||||
|
|
||||||
|
# Download precompiled ttyd binary from GitHub releases
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y wget && \
|
||||||
|
wget https://github.com/tsl0922/ttyd/releases/download/1.6.3/ttyd.x86_64 -O /usr/bin/ttyd && \
|
||||||
|
chmod +x /usr/bin/ttyd && \
|
||||||
|
apt-get remove -y wget && \
|
||||||
|
apt-get autoremove -y && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
COPY requirements.txt ./
|
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
RUN python -m venv pilot-env
|
RUN python -m venv pilot-env
|
||||||
RUN source pilot-env/bin/activate
|
RUN /bin/bash -c "source pilot-env/bin/activate"
|
||||||
RUN pip install -r requirements.txt
|
|
||||||
RUN python ./pilot/db_init.py
|
|
||||||
|
|
||||||
CMD [ "python", "./pilot/main.py" ]
|
WORKDIR /usr/src/app/pilot
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
EXPOSE 7681
|
||||||
|
CMD ["ttyd", "bash"]
|
||||||
@@ -64,6 +64,15 @@ All generated code will be stored in the folder `workspace` inside the folder na
|
|||||||
**IMPORTANT: To run GPT Pilot, you need to have PostgreSQL set up on your machine**
|
**IMPORTANT: To run GPT Pilot, you need to have PostgreSQL set up on your machine**
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
# 🐳 How to start gpt-pilot in docker?
|
||||||
|
1. `git clone https://github.com/Pythagora-io/gpt-pilot.git` (clone the repo)
|
||||||
|
2. Update the `docker-compose.yml` environment variables
|
||||||
|
3. run `docker compose build`. this will build a gpt-pilot container for you.
|
||||||
|
4. run `docker compose up`.
|
||||||
|
5. access web terminal on `port 7681`
|
||||||
|
|
||||||
|
This will start two containers, one being a new image built by the `Dockerfile` and a postgres database. The new image also has (ttyd)[https://github.com/tsl0922/ttyd] installed so you can easily interact with gpt-pilot.
|
||||||
|
|
||||||
# 🧑💻️ Other arguments
|
# 🧑💻️ Other arguments
|
||||||
- continue working on an existing app
|
- continue working on an existing app
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -2,33 +2,39 @@ version: '3'
|
|||||||
services:
|
services:
|
||||||
gpt-pilot:
|
gpt-pilot:
|
||||||
environment:
|
environment:
|
||||||
|
#OPENAI or AZURE
|
||||||
- ENDPOINT=OPENAI
|
- ENDPOINT=OPENAI
|
||||||
- OPENAI_API_KEY=
|
- OPENAI_API_KEY=
|
||||||
|
# - AZURE_API_KEY=
|
||||||
|
# - AZURE_ENDPOINT=
|
||||||
|
#In case of Azure endpoint, change this to your deployed model name
|
||||||
- MODEL_NAME=gpt-4
|
- MODEL_NAME=gpt-4
|
||||||
- MAX_TOKENS=8192
|
- MAX_TOKENS=8192
|
||||||
- DB_NAME=gpt-pilot
|
- DATABASE_TYPE=postgres
|
||||||
|
- DB_NAME=pilot
|
||||||
- DB_HOST=postgres
|
- DB_HOST=postgres
|
||||||
- DB_PORT=5432
|
- DB_PORT=5432
|
||||||
- DB_USER=gpt-pilot
|
- DB_USER=pilot
|
||||||
- DB_PASSWORD=gpt-pilot
|
- DB_PASSWORD=pilot
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
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:
|
ports:
|
||||||
- "5050:80"
|
- "7681:7681"
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres
|
image: postgres
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: gpt-pilot
|
POSTGRES_USER: pilot
|
||||||
POSTGRES_PASSWORD: gpt-pilot
|
POSTGRES_PASSWORD: pilot
|
||||||
POSTGRES_DB: gpt-pilot
|
POSTGRES_DB: pilot
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "5432:5432"
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U user"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
|||||||
Reference in New Issue
Block a user