How to deploy Parse Server with Docker?
Parse provides an application stack for back-end, and it is very popular especially among on mobile developers. There are a wide community and documentation.
We can deploy Parse Server and Dashboard with Docker easily. In this article, I am going to show how to deploy on your local machine.
I will use docker commands but you can use also Kitematic.
Step 1 — MongoDB
First of all, we are going to deploy a MongoDB. I named as “parse-mongo-db“ and set two environmental parameters to determine username and password.
docker run --name parse-mongo-db \
-e MONGO_INITDB_ROOT_USERNAME=admin \
-e MONGO_INITDB_ROOT_PASSWORD=admin \
-d mongo
Step 2 — Parse Server
In this step, we deploy Parse Server with some environmental parameters. You can change application and and master key. In addition of this, I set MongoDB URI. Finally, Parse Server and MongoDB containers are linked each other using “--link parse-mongo-db:mongo’.
docker run --name parse-server-1 \
-e PARSE_SERVER_APPLICATION_ID=APP_ID_1 \
-e PARSE_SERVER_MASTER_KEY=MASTER_KEY_1 \
-e PARSE_SERVER_DATABASE_URI=mongodb://admin:admin@mongo/parse_server?authSource=admin \
--link parse-mongo-db:mongo \
-d -p 1337:1337 parseplatform/parse-server
Step 3 — Parse Dashboard
We install dashboard app using following command. We have to pair APP_ID and MASTER_KEY according to server parameters. In addition of that, I set user id and password to secure dashboard. Finally, I work on local machine and I am not using SSL, because of this, I set ALLOW_INSECURE_HTTP parameter as true.
docker run --name parse-dashboard-1 \
-e PARSE_DASHBOARD_APP_ID=APP_ID_1 \
-e PARSE_DASHBOARD_MASTER_KEY=MASTER_KEY_1 \
-e PARSE_DASHBOARD_USER_ID=admin \
-e PARSE_DASHBOARD_USER_PASSWORD=admin \
-e PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=true \
-e PARSE_DASHBOARD_SERVER_URL=http://localhost:1337/parse \
-d -p 4040:4040 parseplatform/parse-dashboard
…and success!
On next article, I will deploy it into Amazon ECS.