Skip to content

Commit fd27b5b

Browse files
committed
docs: add docker deployment documentation
1 parent 4c97627 commit fd27b5b

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

.env.example

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
APP_ID=myAppId
2+
MASTER_KEY=myMasterKey
3+
MONGODB_URI=mongodb://localhost:27017/parse
4+
PORT=1337
5+
SERVER_URL=http://localhost:1337

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ node_modules
3333

3434
# build folder
3535
dist
36+
37+
# env files
38+
.env*
39+
!.env.example

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The [Parse Server guide](https://docs.parseplatform.org/parse-server/guide/) is
2323
---
2424

2525
- [Local Development](#local-development)
26+
- [Docker Deployment](#docker-deployment)
2627
- [Helpful Scripts](#helpful-scripts)
2728
- [Remote Deployment](#remote-deployment)
2829
- [Heroku](#heroku)
@@ -50,6 +51,35 @@ The [Parse Server guide](https://docs.parseplatform.org/parse-server/guide/) is
5051
7. By default the API route will use `/parse` as a base. You can change this by setting the environment variable `PARSE_MOUNT`, for example in the CLI run run `export PARSE_MOUNT=/app` to set the path to `app`.
5152
8. Your Parse Server is not running and is connected to your local database named `dev` in which the data is stored that you manage via Parse Server.
5253

54+
## Docker Deployment
55+
56+
You can also run Parse Server using Docker:
57+
58+
1. Create a `.env` file with your configuration variables. For example:
59+
```
60+
APP_ID=myAppId
61+
MASTER_KEY=myMasterKey
62+
DATABASE_URI=mongodb://localhost:27017/parse
63+
PORT=1337
64+
PARSE_MOUNT=/parse
65+
```
66+
67+
2. Run Docker with the following command, mounting volumes as needed:
68+
```
69+
docker build -t parse-server .
70+
docker run -p 1337:1337 --env-file .env \
71+
-v $(pwd)/logs:/usr/src/parse/logs \
72+
-v $(pwd)/cloud:/usr/src/parse/cloud \
73+
parse-server
74+
```
75+
76+
This allows you to:
77+
- Use an environment file for configuration
78+
- Mount the logs directory to persist logs outside the container
79+
- Mount the cloud directory to access your Cloud Code files from the container
80+
81+
You can customize the mounted volumes based on your needs, such as mounting config files or other directories that require persistence or runtime modifications.
82+
5383
## Helpful Scripts
5484
These scripts can help you to develop your app for Parse Server:
5585

0 commit comments

Comments
 (0)