1
1
mirror of https://github.com/aelve/guide.git synced 2024-11-22 20:01:36 +03:00

Fix dockerfile and readme (#282)

* Fix dockerfile and readme

* Fix up
This commit is contained in:
Vladislav Sabanov 2019-04-27 01:41:12 +05:00 committed by GitHub
parent 43da382888
commit e85eca1b66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 10 deletions

View File

@ -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

View File

@ -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`