├── .gitignore ├── LICENSE.md ├── README.md ├── docker-compose.yml ├── parse-dashboard ├── Dockerfile ├── config.json └── package.json └── parse-server ├── Dockerfile ├── index.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.cer -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2017 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mongodb & [parse-server](http://parseplatform.org/) & [parse-dashboard](https://github.com/parse-community/parse-dashboard) 2 | 3 | > Work in progress, testing... 4 | 5 | ## Config(s) 6 | 7 | Check the `docker-compose.yml` to change the `APP_ID` and the `MASTER_KEY` for the `parse-server`. 8 | Then, make sure to connect the `parse-dashboard` checking the `parse-dashboard/config.json` and fix the configuration properly. 9 | 10 | ## APNS and GCM for Push Notifications 11 | You may want to send Push Notifications with the Parse server, you must configure GCM and APNS. 12 | > NOTE: don't forget to add the ***.p12*** certificate to your `parse-server` container, needed for Apple Push Notifications. You can modify the `parse-server/Dockerfile`: 13 | ``` 14 | ... 15 | 16 | ADD ./path-to-certificate.p12 ${PARSE_HOME} 17 | ... 18 | ``` 19 | 20 | 21 | ## First run 22 | 23 | $ git clone https://github.com/LasaleFamine/docker-mongo-parse-server mongo-parse-server 24 | $ cd mongo-parse-server 25 | $ docker-compose up # add -d for `demon` mode 26 | 27 | ## Build (if you make changes within the `Dockerfile`s) 28 | 29 | $ docker-compose build 30 | 31 | ## License 32 | 33 | MIT © LasaleFamine 34 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | mongo-parse-server: 4 | image: mongo 5 | volumes: 6 | - ./db:/data/db 7 | parse-server: 8 | build: ./parse-server 9 | links: 10 | - mongo-parse-server:mongo 11 | environment: 12 | - APP_ID=something_nice_and_secret 13 | - MASTER_KEY=long-secret-awesome 14 | - GCM_SENDER_ID=gcm_id 15 | - GCM_API_KEY=gcm_key 16 | - PFX_PATH_DEV=path_to_certificate_p12 17 | - PFX_PASS_DEV=passphrase_certificate 18 | - PFX_PATH_PROD=path_to_certificate_p12 19 | - PFX_PATH_PROD=passphrase_certificate 20 | - APP_BUNDLE_ID=bundle_id 21 | - IS_PRODUCTION=false 22 | ports: 23 | - 1337:1337 24 | parse-dashboard: 25 | build: ./parse-dashboard 26 | environment: 27 | - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 28 | ports: 29 | - 4040:4040 30 | -------------------------------------------------------------------------------- /parse-dashboard/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node 2 | 3 | USER node 4 | 5 | ENV PORT 4040 6 | ENV PARSE_HOME /home/node/parse-dashboard 7 | 8 | RUN mkdir -p ${PARSE_HOME} 9 | ADD ./package.json ${PARSE_HOME} 10 | ADD ./config.json ${PARSE_HOME} 11 | 12 | WORKDIR ${PARSE_HOME} 13 | 14 | RUN npm install 15 | 16 | EXPOSE ${PORT} 17 | 18 | CMD [ "npm", "start" ] -------------------------------------------------------------------------------- /parse-dashboard/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apps": [ 3 | { 4 | "serverURL": "http://localhost:1337/parse", 5 | "appId": "something_nice_and_secret", 6 | "masterKey": "long-secret-awesome", 7 | "appName": "MyApp" 8 | } 9 | ], 10 | "users": [ 11 | { 12 | "user":"foo", 13 | "pass":"bar" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /parse-dashboard/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "parse-dashboard", 3 | "scripts": { 4 | "start": "parse-dashboard --config config.json --host 0.0.0.0 --port 4040" 5 | }, 6 | "dependencies": { 7 | "parse-dashboard": "*" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /parse-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node 2 | 3 | USER node 4 | 5 | ENV PORT 1337 6 | # ENV APP_ID someappid 7 | # ENV MASTER_KEY somemasterkey 8 | # ENV DATABASE_URI mongodb://mongo/test 9 | 10 | ENV PARSE_HOME /home/node/parse-server 11 | 12 | RUN mkdir -p ${PARSE_HOME} 13 | ADD ./package.json ${PARSE_HOME} 14 | ADD ./index.js ${PARSE_HOME} 15 | 16 | WORKDIR ${PARSE_HOME} 17 | 18 | RUN npm install 19 | 20 | EXPOSE ${PORT} 21 | 22 | CMD [ "npm", "start" ] -------------------------------------------------------------------------------- /parse-server/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const ParseServer = require('parse-server').ParseServer; 3 | const app = express(); 4 | 5 | const { 6 | APP_ID, 7 | MASTER_KEY, 8 | GCM_SENDER_ID, 9 | GCM_API_KEY, 10 | PFX_PATH_DEV, 11 | PFX_PASS_DEV, 12 | PFX_PATH_PROD, 13 | PFX_PASS_PROD, 14 | APP_BUNDLE_ID, 15 | IS_PRODUCTION 16 | } = process.env; 17 | 18 | const api = new ParseServer({ 19 | databaseURI: 'mongodb://mongo-parse-server/', // Connection string for your MongoDB database 20 | appId: APP_ID, 21 | masterKey: MASTER_KEY, 22 | fileKey: 'optionalFileKey', 23 | serverURL: 'http://localhost:1337/parse', // Don't forget to change to https if needed 24 | push: { 25 | android: { 26 | senderId: GCM_SENDER_ID, 27 | apiKey: GCM_API_KEY 28 | }, 29 | ios: [ 30 | { 31 | pfx: PFX_PATH_DEV, // The filename of private key and certificate in PFX or PKCS12 format from disk 32 | passphrase: PFX_PASS_DEV, // optional password to your p12 33 | bundleId: APP_BUNDLE_ID, // The bundle identifier associate with your app 34 | production: false // Specifies which APNS environment to connect to: Production (if true) or Sandbox 35 | }, 36 | { 37 | pfx: PFX_PATH_PROD, // Prod PFX or P12 38 | bundleId: PFX_PASS_PROD, 39 | production: true // Prod 40 | } 41 | ] 42 | } 43 | }); 44 | 45 | // Serve the Parse API on the /parse URL prefix 46 | app.use('/parse', api); 47 | 48 | app.listen(1337, () => { 49 | console.log('parse-server running on port 1337.'); 50 | }); -------------------------------------------------------------------------------- /parse-server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "parse-server", 3 | "scripts": { 4 | "start": "node index.js" 5 | }, 6 | "dependencies": { 7 | "parse-server": "*", 8 | "express": "*" 9 | } 10 | } 11 | --------------------------------------------------------------------------------