Skip to content

Commit 9524cf2

Browse files
committed
docs: add docker deployment documentation
1 parent 888c3da commit 9524cf2

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
@@ -22,6 +22,7 @@ The [Parse Server guide](https://docs.parseplatform.org/parse-server/guide/) is
2222
---
2323

2424
- [Local Development](#local-development)
25+
- [Docker Deployment](#docker-deployment)
2526
- [Helpful Scripts](#helpful-scripts)
2627
- [Remote Deployment](#remote-deployment)
2728
- [Heroku](#heroku)
@@ -49,6 +50,35 @@ The [Parse Server guide](https://docs.parseplatform.org/parse-server/guide/) is
4950
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`.
5051
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.
5152

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

5484
These scripts can help you to develop your app for Parse Server:

0 commit comments

Comments
 (0)