-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Introducing Docker Compose for Enhanced Development Experience #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
teamchong
wants to merge
12
commits into
OpenBMB:main
Choose a base branch
from
teamchong:teamchong/add-docker-compose
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
bd17b4d
feat: Add docker compose for better DX
teamchong ad196e3
refactor: using docker compose v2
teamchong 22fba50
fix: DISPLAY value
teamchong c713701
feat: add cache or sensitve files to .dockerignore
teamchong b87e912
refactor: rename Dockerfile.dev for syntax highlight
teamchong 03d7f73
refactor: omit ENV OPENAI_API_KEY
teamchong bfc8e7e
refactor: use /bin/bash as entrypoint
teamchong f7acd85
refactor: load all .env variables
teamchong 72d18e0
docs: update wiki.md
teamchong 472745a
docs: update wiki.md
teamchong a361c2d
refactor: allow specfic DEFAULT_CMD on .env
teamchong 21c6372
docs: Update wiki.md for .env setup and remove .env.sample
teamchong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-egg/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
pytest_cache/ | ||
cover/ | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask instance folder | ||
instance/ | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# Environment variables | ||
.env | ||
|
||
# Virtual environment | ||
venv/ | ||
.venv/ | ||
ENV/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# VS Code settings | ||
.vscode/ | ||
|
||
# PyCharm | ||
.idea/ | ||
|
||
# Operating system files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
# Git directory | ||
.git/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
.vscode | ||
|
||
# env | ||
.env/ | ||
.env | ||
.venv/ | ||
env/ | ||
venv/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
# Start with a Python 3.9 base image | ||
FROM python:3.9-slim | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy the current directory contents into the container at /app | ||
COPY . /app | ||
|
||
# Install necessary libraries for GUI support | ||
RUN apt-get update && apt-get install -y python3-tk x11-apps | ||
|
||
# Install the project dependencies | ||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy only the requirements file and install dependencies | ||
COPY requirements.txt ./ | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Set the environment variable for OpenAI API key | ||
# (you'll need to provide the actual key when running the container) | ||
ENV OPENAI_API_KEY=your_OpenAI_API_key | ||
ENV OPENAI_API_KEY= | ||
|
||
# Expose the port for visualizer/app.py | ||
EXPOSE 8000 | ||
|
||
# Set an entry point that runs a shell for interactive mode | ||
ENTRYPOINT ["/bin/bash"] | ||
ARG DEFAULT_CMD= | ||
ENV COMMAND=${DEFAULT_CMD:-/bin/bash} | ||
CMD ${COMMAND} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Start with a Python 3.9 base image | ||
FROM python:3.9-slim | ||
|
||
# Install necessary libraries for GUI support | ||
RUN apt-get update && apt-get install -y python3-tk x11-apps | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy only the requirements file and install dependencies | ||
COPY requirements.txt ./ | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# No need to copy the rest of the application code as we use bind mounts | ||
# COPY . . | ||
|
||
# Expose the port for online_log/app.py | ||
EXPOSE 8000 | ||
|
||
CMD ["/bin/bash"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
services: | ||
chatdev: | ||
build: | ||
context: . | ||
dockerfile: dev.Dockerfile | ||
command: ${DEFAULT_CMD:-/bin/bash} | ||
environment: | ||
- DISPLAY=host.docker.internal:0.0 | ||
env_file: | ||
- ./.env | ||
ports: | ||
- "${PORT:-8000}:8000" | ||
stdin_open: true | ||
tty: true | ||
volumes: | ||
- .:/app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.