Skip to content

Commit 71fb6ce

Browse files
woyorusflovilmart
authored andcommitted
Dockerizing Parse Server (#3005)
* Add Dockerfile * Add Docker image docs * Remove default PARSE_SERVER_CLOUD_CODE_MAIN setting + update docs * Update docs * Update documentation
1 parent 2fb4f89 commit 71fb6ce

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed

.dockerignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
node_modules
2+
npm-debug.log
3+
*.md
4+
PATENTS
5+
LICENSE
6+
Dockerfile
7+
.dockerignore
8+
.gitignore
9+
.travis.yml
10+
.istanbul.yml
11+
.git
12+
.github
13+
14+
# Build folder
15+
lib/
16+
17+
# Tests
18+
spec/
19+
20+
# IDEs
21+
.idea/

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM node:boron
2+
3+
RUN mkdir -p /parse-server
4+
COPY ./ /parse-server/
5+
6+
RUN mkdir -p /parse-server/config
7+
VOLUME /parse-server/config
8+
9+
RUN mkdir -p /parse-server/cloud
10+
VOLUME /parse-server/cloud
11+
12+
WORKDIR /parse-server
13+
14+
RUN npm install && \
15+
npm run build
16+
17+
ENV PORT=1337
18+
19+
EXPOSE $PORT
20+
21+
ENTRYPOINT ["npm", "start", "--"]

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,22 @@ April 2016 - We created a series of video screencasts, please check them out her
1616

1717
The fastest and easiest way to get started is to run MongoDB and Parse Server locally.
1818

19-
## Running Parse Server locally
19+
## Running Parse Server
2020

21+
### Locally
2122
```
2223
$ npm install -g parse-server mongodb-runner
2324
$ mongodb-runner start
2425
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test
2526
```
2627

28+
### Inside a Docker container
29+
```
30+
$ docker build --tag my-parse-server .
31+
$ docker run --name my-mongo -d mongo
32+
$ docker run --name my-parse-server --link my-mongo:mongo parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test
33+
```
34+
2735
You can use any arbitrary string as your application id and master key. These will be used by your clients to authenticate with the Parse Server.
2836

2937
That's it! You are now running a standalone version of Parse Server on your machine.

0 commit comments

Comments
 (0)