Skip to content

Commit

Permalink
Add dockerfile and Railway one click deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
xingfanxia committed Apr 1, 2023
1 parent 59b4b52 commit 32648d6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__/
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.9
RUN apt-get update && apt-get install -y build-essential ffmpeg
COPY requirements.txt .
RUN pip install --user -r requirements.txt

ENV PATH=/root/.local/bin:$PATH
ENV OPENAI_API_KEY your_api_key
ENV FLASK_APP=main.py
COPY . /app
WORKDIR /app
CMD ["flask", "run", "--host=0.0.0.0", "--port=5000"]
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ Follow these steps to set up the project environment:
4. [Optional] Activate the virtual environment: `venv\Scripts\activate` for Windows or `source venv/bin/activate` for Linux/Mac.
5. Install the required dependencies: `pip install -r requirements.txt`
6. Set up your OpenAI API key as an environment variable: `set OPENAI_API_KEY=your_api_key_here` for Windows and `export OPENAI_API_KEY=your_api_key_here` for Linux/Mac.
7. Run the development server: `python app.py`
7. Run the development server: `python main.py`

Open your browser and navigate to http://localhost:5000 to access the web app.

⚠️ Warning

This project is set up to use a development server, which is not suitable for production use. Please ensure that you do not deploy the application with the development server for production purposes. Instead, use a production-ready web server, such as Gunicorn or uWSGI, in conjunction with a reverse proxy like Nginx or Apache.
This project is set up to use a development server, which is not suitable for production use. Please ensure that you do not deploy the application with the development server for production purposes. Instead, use a production-ready web server, such as Gunicorn or uWSGI, in conjunction with a reverse proxy like Nginx or Apache.

## Docker usage
One click deploy via Railway:
[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/JINxPn?referralCode=GfxT3U)

0 comments on commit 32648d6

Please sign in to comment.