Adding new deploy configuration

This commit is contained in:
Matias committed 2019-04-28 10:06:54 -03:00
1 parent 320112d8a7
commit bcaf68658b
4 files changed
+33 -13

No files matched your search

+1 -10
View File
@@ -6,14 +6,8 @@
# testing
/coverage
# production
/build
/logs
# misc
.env
.DS_Store
.env.local
.env.development.local
.env.test.local
@@ -22,7 +16,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
#Docker
Dockerfile
docker-compose.prod.yml
config
+25
View File
@@ -0,0 +1,25 @@
FROM mhart/alpine-node:12
# Directory where the service will be installed
ARG API_DIR=/usr/src/clonesapi
# Prepare required directories
RUN mkdir -p ${API_DIR} && \
mkdir -p /root/.kube
# Use app directory as current workdir
WORKDIR ${API_DIR}
# ENV PATH /var/www/app/node_modules/.bin:$PATH
# Copy package.json to workdir
COPY package*.json ${API_DIR}/
# Install dependencies
RUN npm install --production
# Copy application code
COPY . ${API_DIR}
COPY ./config /root/.kube
# Expose Port
EXPOSE $PORT
+6 -2
View File
@@ -1,7 +1,11 @@
{
"name": "operations-server",
"name": "clones-api",
"version": "1.0.0",
"description": "Superalgos Operations backend API",
"description": "Superalgos Clones backend API",
"repository": {
"type": "git",
"url": "https://github.com/Superalgos/OperationsModule.git"
},
"main": "src/index.js",
"scripts": {
"start": "nodemon --exec babel-node --presets env,stage-2 src/index.js",
+1 -1
View File
@@ -21,7 +21,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.')