Adding new deploy configuration

This commit is contained in:
Matias committed 2019-05-01 12:48:53 -03:00
1 parent e00a847ef2
commit 184c6adb42
8 files changed
+994 -1411

No files matched your search

-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
+22
View File
@@ -0,0 +1,22 @@
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 package*.json ${API_DIR}/
# Install dependencies
RUN npm install --production
# Copy application code
COPY . ${API_DIR}
# 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
+917 -1398
View File
File diff suppressed because it is too large. Load diff
+3 -3
View File
@@ -1,9 +1,9 @@
{
"name": "strategizer-server",
"version": "0.0.1",
"description": "Advanced Algos strategizer backend API",
"author": "",
"license": "",
"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;