Dockerizing Parse Server (#3005)
* Add Dockerfile * Add Docker image docs * Remove default PARSE_SERVER_CLOUD_CODE_MAIN setting + update docs * Update docs * Update documentation
This commit is contained in:
committed by
Florent Vilmart
parent
2fb4f89324
commit
71fb6cef5e
21
.dockerignore
Normal file
21
.dockerignore
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
node_modules
|
||||||
|
npm-debug.log
|
||||||
|
*.md
|
||||||
|
PATENTS
|
||||||
|
LICENSE
|
||||||
|
Dockerfile
|
||||||
|
.dockerignore
|
||||||
|
.gitignore
|
||||||
|
.travis.yml
|
||||||
|
.istanbul.yml
|
||||||
|
.git
|
||||||
|
.github
|
||||||
|
|
||||||
|
# Build folder
|
||||||
|
lib/
|
||||||
|
|
||||||
|
# Tests
|
||||||
|
spec/
|
||||||
|
|
||||||
|
# IDEs
|
||||||
|
.idea/
|
||||||
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
FROM node:boron
|
||||||
|
|
||||||
|
RUN mkdir -p /parse-server
|
||||||
|
COPY ./ /parse-server/
|
||||||
|
|
||||||
|
RUN mkdir -p /parse-server/config
|
||||||
|
VOLUME /parse-server/config
|
||||||
|
|
||||||
|
RUN mkdir -p /parse-server/cloud
|
||||||
|
VOLUME /parse-server/cloud
|
||||||
|
|
||||||
|
WORKDIR /parse-server
|
||||||
|
|
||||||
|
RUN npm install && \
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
ENV PORT=1337
|
||||||
|
|
||||||
|
EXPOSE $PORT
|
||||||
|
|
||||||
|
ENTRYPOINT ["npm", "start", "--"]
|
||||||
10
README.md
10
README.md
@@ -16,14 +16,22 @@ April 2016 - We created a series of video screencasts, please check them out her
|
|||||||
|
|
||||||
The fastest and easiest way to get started is to run MongoDB and Parse Server locally.
|
The fastest and easiest way to get started is to run MongoDB and Parse Server locally.
|
||||||
|
|
||||||
## Running Parse Server locally
|
## Running Parse Server
|
||||||
|
|
||||||
|
### Locally
|
||||||
```
|
```
|
||||||
$ npm install -g parse-server mongodb-runner
|
$ npm install -g parse-server mongodb-runner
|
||||||
$ mongodb-runner start
|
$ mongodb-runner start
|
||||||
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test
|
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Inside a Docker container
|
||||||
|
```
|
||||||
|
$ docker build --tag my-parse-server .
|
||||||
|
$ docker run --name my-mongo -d mongo
|
||||||
|
$ docker run --name my-parse-server --link my-mongo:mongo parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test
|
||||||
|
```
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
That's it! You are now running a standalone version of Parse Server on your machine.
|
That's it! You are now running a standalone version of Parse Server on your machine.
|
||||||
|
|||||||
Reference in New Issue
Block a user