diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..4e03928 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,10 @@ +pipeline: + push-image: + image: + plugins/docker + repo: + unitq/sample-callback-server-node + tags: + - ${DRONE_COMMIT_SHA} + - ${DRONE_COMMIT_SHA}--${DRONE_COMMIT_BRANCH} + secrets: [ docker_username, docker_password ] diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ae2dff7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM node:8 + +# Create app directory +WORKDIR /usr/src/app + +# Install app dependencies +# A wildcard is used to ensure both package.json AND package-lock.json are copied +# where available (npm@5+) +COPY package*.json ./ + +RUN npm install +# If you are building your code for production +# RUN npm install --only=production + +# Bundle app source +COPY . . + +EXPOSE 8080 +CMD [ "npm", "start" ] diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..d06c215 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,25 @@ +version: '2.1' +services: + scaleapi-callback-server: + image: + scaleapi:latest + container_name: + scaleapi-callback-server + environment: + - MONGODB_URI=scaleapi-callback-service-db + ports: + - "3000:3000" +# depends_on: +# reviewservice-db: +# condition: service_healthy + + scaleapi-callback-service-db: + image: + mongo:3.2.21-jessie + container_name: + scaleapi-callback-service-db + ports: + - "27017:27017" +# healthcheck: +# test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] +# timeout: 20s diff --git a/taskModel.js b/taskModel.js index 9bc8846..d9d3cff 100644 --- a/taskModel.js +++ b/taskModel.js @@ -16,7 +16,8 @@ var schema = new Schema({ instruction: String, params: Schema.Types.Mixed, response: Schema.Types.Mixed, - urgency: String + urgency: String, + metadata: Schema.Types.Mixed }); var model = mongoose.model('task', schema);