Skip to content
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

volumes and hot reloading for continuous development in docker #124

Merged
merged 3 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.env
.env.gcp.yaml
redis-volume/
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ RUN rm poetry.lock

RUN pip install .

CMD exec uvicorn app.server:app --host 0.0.0.0 --port $PORT
CMD exec uvicorn app.server:app --host 0.0.0.0 --port $PORT --reload
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ services:
- redis
env_file:
- .env
volumes:
- ./backend:/backend
environment:
PORT: 8100
REDIS_URL: "redis://redis:6379"

frontend:
build:
context: frontend
volumes:
- ./frontend/src:/frontend/src
ports:
- "5173:5173" # Frontend is accessible on localhost:5173
environment:
Expand Down
3 changes: 3 additions & 0 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()],
server: {
watch: {
usePolling: true
},
proxy: {
"^/(assistants|threads|ingest|runs)": {
target: process.env.VITE_BACKEND_URL || "http://127.0.0.1:8100",
Expand Down