Merge pull request #12 from AAVikings/develop

Node configuration
This commit is contained in:
benme authored and GitHub committed 2019-05-14 10:26:58 -03:00
commit 24b1421980
9 files changed
+1009 -1415

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
# Ignore files to be uploaded to the image
.env
.env.dev
.env.prod
.git
.gitignore
Dockerfile
Dockerfile.prod
README.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
/coverage
/.nyc_output
-9
View File
@@ -1,9 +0,0 @@
PRESHARED_GATEWAY_KEY=SECRET_STUFF
PORT=3000
DB_USERNAME=example_name
DB_PASSWORD=example_password
DB_DOMAIN=example.com:1234/example_name
GATEWAY_ENDPOINT=https://platform-api-dev.superalgos.org/graphql/
+6
View File
@@ -0,0 +1,6 @@
NODE_ENV=production
PORT=4008
MONGO_URL=mongodb://mongo/strategies
PRESHARED_GATEWAY_KEY=strategizer_keys
+19
View File
@@ -0,0 +1,19 @@
FROM mhart/alpine-node:12
# Directory where the service will be installed
ARG API_DIR=/usr/src/strategizer-api
# Prepare required directories
RUN mkdir -p ${API_DIR}
# Use app directory as current workdir
WORKDIR ${API_DIR}
# Copy package.json to workdir
COPY . ${API_DIR}/
# Install dependencies
RUN npm install --production
# Expose Port
EXPOSE $PORT
+21
View File
@@ -0,0 +1,21 @@
FROM mhart/alpine-node:8
ENV PORT=4008
RUN mkdir -p /var/www/app && \
mkdir -p /var/www/app/node_modules
# Use app directory as current workdir
WORKDIR /var/www/app
ENV PATH /var/www/app/node_modules/.bin:$PATH
# Copy package.json to workdir
COPY package.json /var/www/app/package.json
# Install dependencies
RUN npm install
# Copy application code
COPY . /var/www/app
# Expose Port
EXPOSE $PORT
+24
View File
@@ -0,0 +1,24 @@
version: '3'
services:
node:
image: aastrategizerapi-dev:v1
build:
context: .
dockerfile: ./Dockerfile.prod
env_file: ./.env
container_name: aastrategizerapi
tty: true
stdin_open: true
volumes:
- ./:/var/www/app
- /var/www/app/node_modules
working_dir: /var/www/app
restart: always
command: npm start
expose:
- 4008
network_mode: webproxy
networks:
default:
external:
name: webproxy
+919 -1400
View File
File diff suppressed because it is too large. Load diff
+5 -5
View File
@@ -1,9 +1,9 @@
{
"name": "strategizer-server",
"version": "0.0.1",
"description": "Advanced Algos strategizer backend API",
"author": "",
"license": "",
"name": "@superalgos/strategizer-api",
"version": "0.1.0",
"description": "Superalgos strategizer backend API",
"author": "Superalgos, ltd.",
"license": "Apache-2.0",
"main": "src/index.js",
"repository": {
"type": "git",
+1 -1
View File
@@ -1,7 +1,7 @@
import 'dotenv/config';
import mongoose from 'mongoose';
mongoose.connect(`mongodb://${process.env.DB_USERNAME}:${process.env.DB_PASSWORD}@${process.env.DB_DOMAIN}`, { useNewUrlParser: true });
mongoose.connect(process.env.MONGO_URL, { useNewUrlParser: true })
mongoose.set('useCreateIndex', true);
mongoose.set('useFindAndModify', false);
mongoose.Promise = global.Promise;