| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
You should not build your parse-server image instead of reuse this yongjhih/parse-server image, then plugin your parse-cloud-code container (allow dynamic update) and mongodb container.
Welcome PR.
Here is overview:
Features:
Most pulled:
$ docker run -d -p 27017:27017 --name mongo mongo
$ docker run -d \
-e APP_ID={appId} \
-e MASTER_KEY={masterKey} \
-p 1337:1337 \
-p 2022:22 \
--link mongo \
--name parse-server \
yongjhih/parse-server
# Test parse-server
$ curl -X POST \
-H "X-Parse-Application-Id: {appId}" \
-H "Content-Type: application/json" \
-d '{}' \
http://localhost:1337/parse/functions/hello
$ docker run -d \
-e APP_ID={appId} \
-e MASTER_KEY={masterKey} \
-p 4040:4040 \
--link parse-server \
--name parse-dashboard \
yongjhih:parse-dashboardor with docker-compose:
$ wget https://github.com/yongjhih/docker-parse-server/raw/master/docker-compose.yml
$ APP_ID=myAppId MASTER_KEY=myMasterKey docker-compose up -dDeploy parse-cloud-code via git:
$ docker exec -i parse-server ssh-add-key < ~/.ssh/id_rsa.pub
$ git clone ssh://git@localhost:2022/parse-cloud-code
$ cd parse-cloud-code
$ echo "Parse.Cloud.define('hello', function(req, res) { res.success('Hi, git'); });" > main.js
$ git add main.js && git commit -m 'Update main.js'
$ git push origin master
$ curl -X POST \
-H "X-Parse-Application-Id: {appId}" \
-H "Content-Type: application/json" \
-d '{}' \
http://localhost:1337/parse/functions/hello$ docker run -d \
-e DATABASE_URI={mongodb://mongodb.intra:27017/dev} \
-e APP_ID={appId} \
-e MASTER_KEY={masterKey} \
-p 1337:1337 \
-p 2022:22 \
--name parse-server \
yongjhih/parse-serveror with docker-compose:
$ wget https://github.com/yongjhih/docker-parse-server/raw/master/docker-compose.yml
$ DATABASE_URI={mongodb://mongodb.intra:27017/dev} APP_ID={appId} MASTER_KEY={masterKey} docker-compose upWith host folder:
$ docker run -d \
-v {/home/yongjhih/parse/cloud}:/parse/cloud \
-e DATABASE_URI={mongodb://mongodb.intra:27017/dev} \
-e APP_ID={appId} \
-e MASTER_KEY={masterKey} \
-p 1337:1337 \
-p 2022:22 \
--link mongo \
--name parse-server \
yongjhih/parse-serverWith volume container:
$ docker create --name parse-cloud-code \
-v /parse/cloud \
{yongjhih/parse-cloud-code} echo ls /parse/cloud
$ docker run -d \
--volumes-from parse-cloud-code \
-e DATABASE_URI={mongodb://mongodb.intra:27017/dev} \
-e APP_ID={appId} \
-e MASTER_KEY={masterKey} \
-p 1337:1337 \
-p 2022:22 \
--link mongo \
--name parse-server \
yongjhih/parse-serverSpecify parse-server:2.1.4:
$ docker run -d \
-e APP_ID={appId} \
-e MASTER_KEY={masterKey} \
-p 1337:1337 \
-p 2022:22 \
--link mongo \
--name parse-server \
yongjhih/parse-server:2.1.4ref. https://github.com/ParsePlatform/parse-server/releases ref. https://www.npmjs.com/package/parse-server
$ docker run -d \
-e APP_ID={appId} \
-e MASTER_KEY={masterKey} \
-p 1337:1337 \
-p 2022:22 \
--link mongo \
--name parse-server \
yongjhih/parse-server:devWithout docker-compose:
With docker-compose.yml:
# ...
parse-cloud-code:
# ...
image: {username}/parse-cloud-code # Specify your parse-cloud-code image
# ...docker-compose upEnvironment:
# ...
parse-server:
# ...
environment:
DATABASE_URI: $DATABASE_URI
APP_ID: $APP_ID
MASTER_KEY: $MASTER_KEY
PARSE_MOUNT: $PARSE_MOUNT # /parse
COLLECTION_PREFIX: $COLLECTION_PREFIX
CLIENT_KEY: $CLIENT_KEY
REST_API_KEY: $REST_API_KEY
DOTNET_KEY: $DOTNET_KEY
JAVASCRIPT_KEY: $JAVASCRIPT_KEY
DOTNET_KEY: $DOTNET_KEY
FILE_KEY: $FILE_KEY
FACEBOOK_APP_IDS: $FACEBOOK_APP_IDS
SERVER_URL: $SERVER_URL
MAX_UPLOAD_SIZE: $MAX_UPLOAD_SIZE # 20mb
GCM_ID: $GCM_ID
GCM_KEY: $GCM_KEY
PRODUCTION_PFX: $PRODUCTION_PFX
PRODUCTION_BUNDLE_ID: $PRODUCTION_BUNDLE_ID
PRODUCTION_CERT: $PRODUCTION_CERT # prodCert.pem
PRODUCTION_KEY: $PRODUCTION_KEY # prodKey.pem
DEV_PFX: $DEV_PFX
DEV_BUNDLE_ID: $DEV_BUNDLE_ID
DEV_CERT: $DEV_CERT # devCert.pem
DEV_KEY: $DEV_KEY # devKey.pem
VERIFY_USER_EMAILS: $VERIFY_USER_EMAILS # false
ENABLE_ANON_USERS: $ENABLE_ANON_USERS # true
ALLOW_CLIENT_CLASS_CREATION: $ALLOW_CLIENT_CLASS_CREATION # true
APP_NAME: $APP_NAME
PUBLIC_SERVER_URL: $PUBLIC_SERVER_URL
# ...Remote parse-cloud-code image:
# ...
parse-cloud-code:
# ...
image: yongjhih/parse-cloud-code # Specify your parse-cloud-code image
# ...or host folder:
# ...
parse-cloud-code:
# ...
image: yongjhih/parse-server
volumes:
- /home/yongjhih/parse/cloud:/parse/cloud
# ...
# ...$ docker exec -i parse-server ssh-add-key < ~/.ssh/id_rsa.pubImport keys from github:
$ curl https://github.com/yongjhih.keys | docker exec -i parse-server ssh-add-key$ git clone ssh://git@localhost:2022/parse-cloud-code
# ...
$ git push origin masterA detailed tutorial is available here: Azure welcomes Parse developers
A detailed tutorial is available here: Running Parse server on Google App Engine
You can use the REST API, the JavaScript SDK, and any of our open-source SDKs:
Example request to a server running locally:
curl -X POST \
-H "X-Parse-Application-Id: myAppId" \
-H "Content-Type: application/json" \
-d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
http://localhost:1337/parse/classes/GameScore
curl -X POST \
-H "X-Parse-Application-Id: myAppId" \
-H "Content-Type: application/json" \
-d '{}' \
http://localhost:1337/parse/functions/hello
Example using it via JavaScript:
Parse.initialize('myAppId','unused');
Parse.serverURL = 'https://whatever.herokuapp.com';
var obj = new Parse.Object('GameScore');
obj.set('score',1337);
obj.save().then(function(obj) {
console.log(obj.toJSON());
var query = new Parse.Query('GameScore');
query.get(obj.id).then(function(objAgain) {
console.log(objAgain.toJSON());
}, function(err) {console.log(err); });
}, function(err) { console.log(err); });
Example using it on Android:
//in your application class
Parse.initialize(new Parse.Configuration.Builder(getApplicationContext())
.applicationId("myAppId")
.clientKey("myClientKey")
.server("http://myServerUrl/parse/") // '/' important after 'parse'
.build());
ParseObject testObject = new ParseObject("TestObject");
testObject.put("foo", "bar");
testObject.saveInBackground();
You can change the server URL in all of the open-source SDKs, but we're releasing new builds which provide initialization time configuration of this property.
| Back | FazBrowse Home | New Git URL |