Skip to content

Commit

Permalink
update env vars and inject through docker-compose (uselotus#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
diego-escobedo authored Oct 15, 2022
1 parent 05450f6 commit e555b4f
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docker-compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ services:
context: ./frontend
dockerfile: Dockerfile
target: development
env_file:
- ./env/.env.dev
ports:
- 3000:3000
command: yarn run dev --host 0.0.0.0 --port 3000
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ services:
context: ./frontend
dockerfile: Dockerfile
target: production
env_file:
- ./env/.env.prod
stdin_open: true
ports:
- 80:80
Expand Down
16 changes: 16 additions & 0 deletions env/.env.dev.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
SECRET_KEY=change_me
ADMIN_USERNAME=change_me
ADMIN_EMAIL=change_me
ADMIN_PASSWORD=change_me
DOCKERIZED=True
DEBUG=True
SELF_HOSTED=True
STRIPE_SECRET_KEY=change_me
POSTGRES_USER=lotus
POSTGRES_PASSWORD=lotus
POSTGRES_DB_NAME=lotus
PRODUCT_ANALYTICS_OPT_IN=True
DOCKERIZED=True
NODE_ENV=development
VITE_APP_NAME=Lotus-Frontend-Dev
VITE_API_URL="http://localhost:8000/"
16 changes: 16 additions & 0 deletions env/.env.prod.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
SECRET_KEY=change_me
ADMIN_PASSWORD=change_me
ADMIN_EMAIL=change_me
ADMIN_USERNAME=change_me
DOCKERIZED=True
DEBUG=False
SELF_HOSTED=True
STRIPE_SECRET_KEY=change_me
POSTGRES_USER=lotus
POSTGRES_PASSWORD=lotus
POSTGRES_DB_NAME=lotus
NODE_ENV=production
VITE_APP_NAME=Lotus-Frontend-Prod
VITE_API_URL="http://localhost/"
PRODUCT_ANALYTICS_OPT_IN=True

1 change: 1 addition & 0 deletions frontend/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { CreateBacktestType, BacktestType } from "../types/experiment-type";
const cookies = new Cookies();

const API_HOST = import.meta.env.VITE_API_URL;
console.log("API_HOST", API_HOST);

axios.defaults.headers.common["Authorization"] = `Token ${cookies.get(
"Token"
Expand Down

0 comments on commit e555b4f

Please sign in to comment.