diff --git a/docker/front/Dockerfile b/docker/front/Dockerfile index 9473d52..14a1c13 100644 --- a/docker/front/Dockerfile +++ b/docker/front/Dockerfile @@ -6,6 +6,10 @@ ENV LC_ALL=C.UTF-8 # NODE_ENV used to run front server on production ENV NODE_ENV=production +# Overrides for variables in front/config.js +ENV API_URL=https://staging.guide.aelve.com:4400 +ENV PORT=5000 + # Install NodeJS via nvm # replace shell with bash so we can source files diff --git a/front/README.md b/front/README.md index ea278d6..64cdbcd 100644 --- a/front/README.md +++ b/front/README.md @@ -1,15 +1,18 @@ ## Commands - - `dev` - Start developing environment (starts both server and setup client middleware for server). - - `build` - Builds to /dist folder. Compiles (from ts to js) server right in dist folder, client files compiled in /dist/src. +- `dev` - Start developing environment (starts both server and setup client middleware for server). +- `build` - Builds to /dist folder. Compiles (from ts to js) server right in dist folder, client files compiled in /dist/src. ## Deploy process - Node version >= 11, because used fs async methods which experimental now + Requirements: Node version should be >= 11, because of using fs async methods which experimental now. - - `git pull` - - `npm i` - - `npm run build` - - `set NODE_ENV=production`, also you can specify port by `set PORT=%port_number%` and `API_URL=%api_url%` - - `cd dist` - - `npm i` - - `node server` +1. `git pull` +2. `npm i` + +3. Now you have a choice how to set PORT and API_URL. Either set them in front/config.js, or use export (set) PORT=%port_number% API_URL=%api_url% (for example "http://localhost:4400" quotes matter) with dev commands. + +4. `npm run build` +5. `cd dist` +6. `npm i` +7. `export (set) NODE_ENV=production` +8. `node server`