This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3" | |
| services: | |
| app: | |
| container_name: this-app | |
| restart: always | |
| build: ../path-to-this-app/ | |
| volumes: | |
| - .:/src/app | |
| - /src/app/node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM node:8.15-alpine | |
| ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.5.0/wait /wait | |
| RUN chmod +x /wait | |
| RUN mkdir -p /src/app | |
| WORKDIR /src/app | |
| COPY package.json /src/package.json | |
| COPY .npmrc /src/.npmrc | |
| RUN npm install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import mongoose from 'mongoose' | |
| import schema from './schema' | |
| const User = (namespace) => { | |
| const db = mongoose.connection.useDb(namespace, { useCache: true }) | |
| // Add any schema plugins here | |
| return db.model('user', schema) | |
| } | |
| async function get(req, res) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker stop $(docker ps -a -q); docker rm $(docker ps -a -q); docker volume rm $(docker volume ls -qf dangling=true) |
OlderNewer