Merge pull request #75 from AAVikings/master
New version of the clone executor
This commit is contained in:
7 files changed
+80
-14
No files matched your search
+1
-10
@@ -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
|
||||
@@ -0,0 +1,24 @@
|
||||
FROM mhart/alpine-node:12
|
||||
|
||||
# Directory where the service will be installed
|
||||
ARG API_DIR=/usr/src/clones-api
|
||||
|
||||
# Prepare required directories
|
||||
RUN mkdir -p ${API_DIR} && \
|
||||
mkdir -p /root/.kube
|
||||
|
||||
# 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}
|
||||
COPY ./config /root/.kube
|
||||
|
||||
# Expose Port
|
||||
EXPOSE $PORT
|
||||
@@ -0,0 +1,23 @@
|
||||
FROM mhart/alpine-node:8
|
||||
|
||||
ENV PORT=4003
|
||||
|
||||
RUN mkdir -p /var/www/app && \
|
||||
mkdir -p /var/www/app/node_modules && \
|
||||
mkdir -p /root/.kube
|
||||
|
||||
# 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
|
||||
COPY ./config /root/.kube
|
||||
|
||||
# Expose Port
|
||||
EXPOSE $PORT
|
||||
@@ -0,0 +1,24 @@
|
||||
version: '3'
|
||||
services:
|
||||
node:
|
||||
image: aaoperationsapi-dev:v1
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./Dockerfile
|
||||
env_file: ./.env
|
||||
container_name: aaoperationsapi
|
||||
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:
|
||||
- 4003
|
||||
network_mode: webproxy
|
||||
networks:
|
||||
default:
|
||||
external:
|
||||
name: webproxy
|
||||
+6
-2
@@ -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",
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"containers": [
|
||||
{
|
||||
"name": "clone-executor",
|
||||
"image": "superalgos/clone-executor:1.0.3",
|
||||
"image": "superalgos/clone-executor:1.0.4",
|
||||
"command": ["node", "Run.js"],
|
||||
"env": [
|
||||
]
|
||||
|
||||
+1
-1
@@ -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.')
|
||||
|
||||
Reference in new issue
Block a user