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

update .env template #125

Merged
merged 3 commits into from
Oct 26, 2023
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
4 changes: 2 additions & 2 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
volumes:
- .:/app
ports:
- "8000:8000"
- "127.0.0.1:8000:8000"
command: python main.py --reload --host 0.0.0.0 --port 8000
environment:
PYTHONPATH: /app/
Expand All @@ -21,7 +21,7 @@ services:
volumes:
- ./frontend/:/app/frontend/
ports:
- "3000:3000"
- "127.0.0.1:3000:3000"
command: ash -c 'yarn install && yarn start'
environment:
TZ: Asia/Tokyo
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- ../optinist-docker-volumes/logs/:/app/logs
- ../optinist-docker-volumes/studio_data/:/app/studio_data
ports:
- "8000:8000"
- "127.0.0.1:8000:8000"
command: python main.py --host 0.0.0.0 --port 8000
environment:
PYTHONPATH: /app/
Expand Down
7 changes: 7 additions & 0 deletions frontend/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# app config
# PORT=3000 (default: 3000)

# server endpoint
REACT_APP_SERVER_HOST=localhost
REACT_APP_SERVER_PORT=8000
REACT_APP_SERVER_PROTO=http

# running mode (true: standalone mode, false: multi-user mode)
REACT_APP_IS_STANDALONE=true
5 changes: 3 additions & 2 deletions frontend/src/const/API.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const HOST = process.env.REACT_APP_SERVER_HOST ?? "localhost"
const PORT = process.env.REACT_APP_SERVER_PORT ?? 8000
const PROTO = process.env.REACT_APP_SERVER_PROTO ?? "http"

export const BASE_URL = `http://${HOST}:${PORT}`
export const WS_BASE_URL = `ws://${HOST}:${PORT}`
export const BASE_URL =
PORT == null ? `${PROTO}://${HOST}` : `${PROTO}://${HOST}:${PORT}`