Adding new deploy configuration

This commit is contained in:
Matias committed 2019-04-28 11:44:03 -03:00
1 parent 6b4d5750a9
commit 5fd199a93c
8 files changed
+19180 -5

No files matched your search

-3
View File
@@ -2,6 +2,3 @@
client/node_modules/*
server/node_modules/*
server/.env
client/package-lock.json
server/package-lock.json
+13357
View File
File diff suppressed because it is too large. Load diff
+22
View File
@@ -0,0 +1,22 @@
FROM mhart/alpine-node:12
# Directory where the service will be installed
ARG API_DIR=/usr/src/users-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=4000
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: aausersapi-dev:v1
build:
context: .
dockerfile: ./Dockerfile.prod
env_file: ./.env
container_name: aausersapi
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:
- 4000
network_mode: webproxy
networks:
default:
external:
name: webproxy
+5750
View File
File diff suppressed because it is too large. Load diff
+5 -1
View File
@@ -1,7 +1,11 @@
{
"name": "server",
"version": "1.0.0",
"description": "Advanced Algos Users backend API",
"description": "Superalgos Users backend API",
"repository": {
"type": "git",
"url": "https://github.com/Superalgos/UsersModule.git"
},
"main": "src/index.js",
"scripts": {
"start": "nodemon --exec babel-node --presets env,stage-2 src/index.js",
+1 -1
View File
@@ -30,7 +30,7 @@ app.post('/graphql', (req, res, next) => {
app.use(cors())
// Database Connection
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.connection.once('open', () => {
logger.info('Connected to the DB.')