feat: add client to supervisord.conf
This commit is contained in:
parent
15a5dad514
commit
2dc50465ce
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,6 +14,7 @@ __pycache__/
|
||||
*.log
|
||||
*.tmp
|
||||
*.bak
|
||||
*.pid
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
@ -1,7 +1,9 @@
|
||||
from .default import DefaultSettings
|
||||
from .prod import ProdSettings
|
||||
from .utils import get_settings
|
||||
|
||||
__all__ = [
|
||||
"DefaultSettings",
|
||||
"ProdSettings",
|
||||
"get_settings",
|
||||
]
|
||||
|
4
api/api/config/prod.py
Normal file
4
api/api/config/prod.py
Normal file
@ -0,0 +1,4 @@
|
||||
from api.config.default import DefaultSettings
|
||||
|
||||
|
||||
class ProdSettings(DefaultSettings): ...
|
@ -1,13 +1,14 @@
|
||||
from os import environ
|
||||
|
||||
from api.config.default import DefaultSettings
|
||||
from api.config.prod import ProdSettings
|
||||
|
||||
|
||||
def get_settings() -> DefaultSettings:
|
||||
env = environ.get("ENV", "local")
|
||||
env_settings = {
|
||||
"local": DefaultSettings,
|
||||
"prod": None,
|
||||
"prod": ProdSettings,
|
||||
}
|
||||
try:
|
||||
return env_settings[env]()
|
||||
|
5
client/.env.local
Normal file
5
client/.env.local
Normal file
@ -0,0 +1,5 @@
|
||||
REACT_APP_WEBSOCKET_PROTOCOL=ws
|
||||
REACT_APP_HTTP_PROTOCOL=http
|
||||
REACT_APP_API_URL=localhost:8000
|
||||
REACT_APP_URL=localhost:3000
|
||||
BROWSER=none
|
23
client/.gitignore
vendored
23
client/.gitignore
vendored
@ -1,23 +0,0 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
@ -10,7 +10,7 @@ environment=
|
||||
MYSQL_HOST=localhost,
|
||||
MYSQL_USER=connect,
|
||||
MYSQL_PORT=3306,
|
||||
MYSQL_PASSWORD=%(ENV_MYSQL_PASSWORD)s,
|
||||
MYSQL_PASSWORD=hackme,
|
||||
BROKER_PROTOCOL=amqp,
|
||||
BROKER_HOST=localhost,
|
||||
BROKER_USER=guest,
|
||||
@ -25,3 +25,19 @@ stderr_logfile=api.err.log
|
||||
autostart=true
|
||||
autorestart=true
|
||||
startretries=5
|
||||
|
||||
[program:client]
|
||||
environment=
|
||||
REACT_APP_WEBSOCKET_PROTOCOL=ws,
|
||||
REACT_APP_HTTP_PROTOCOL=http,
|
||||
REACT_APP_API_URL=localhost:8000,
|
||||
REACT_APP_URL=localhost:3000
|
||||
command=bash -c 'cd client; npm run build; serve -s build'
|
||||
numprocs=1
|
||||
process_name=node-%(process_num)d
|
||||
stdout_logfile=client.out.log
|
||||
stderr_logfile=client.err.log
|
||||
autostart=true
|
||||
autorestart=true
|
||||
startretries=5
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user