Current docker run does not work parse-server

#1

Hi, I’m pretty newbie regarding Parse, and I was following the steps using docker.

I’ve cloned the repo and run all the commands from the readme.

docker build --tag parse-server .
$ docker run --name my-mongo -d mongo
$ docker run --name my-parse-server --link my-mongo:mongo -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test

When I run docker logs on the container I get:

DEPRECATED: userSensitiveFields has been replaced by protectedFields allowing the ability to protect fields in all classes with CLP. 

appId: APPLICATION_ID
masterKey: ***REDACTED***
masterKeyIps: []
logsFolder: ./logs
databaseURI: mongodb://mongo/test
userSensitiveFields: ["email"]
protectedFields: {"_User":{"*":["email"]}}
enableAnonymousUsers: true
allowClientClassCreation: true
maxUploadSize: 20mb
customPages: {}
sessionLength: 31536000
expireInactiveSessions: true
revokeSessionOnPasswordReset: true
schemaCacheTTL: 5000
cacheTTL: 5000
cacheMaxSize: 10000
objectIdSize: 10
port: 1337
host: 0.0.0.0
mountPath: /parse
scheduledPush: false
collectionPrefix: 
preserveFileName: false
verifyUserEmails: false
preventLoginWithUnverifiedEmail: false
enableSingleSchemaCache: false
enableExpressErrorHandler: false
jsonLogs: false
verbose: false
level: undefined
serverURL: http://localhost:1337/parse

[1] parse-server running on http://localhost:1337/parse

When I try to access the http://localhost:1337/parse I get nothing… nothing is running on that url.

I’m I missing something? Can I provide any other logs? Thanks

#2

It seems that the parse server started successfully in the container named ‘my-parse-server’.
However, the port 1337 in that container is not available from outside that container, eg. your host machine.

So instead of run

$ docker run --name my-parse-server --link my-mongo:mongo -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test

you could try

$ docker run --name my-parse-server --link my-mongo:mongo -p 1337:1337/tcp parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test

Note the “-p 1337:1337/tcp” part, it maps the port 1337 of the container to the 1337 port of your host machine.

I made a quick run of the setup I mentioned above locally(docker-ce 18.09.2, on macos), and it worked as expected.

If that is the case, maybe we should propose a doc fix for this problem.

#3

BTW, you probably want to stop and remove the old ‘my-parse-server’ container, so that the updated “docker run” can be executed successfully.

I did this by:

docker container stop my-parse-server

and

docker container rm my-parse-server

Since I’m not an docker expert, nor do I know your local setup, Just FYI :slight_smile:

#4

Hi, thanks for the fast response @jones0036

It work… kind of. The container is now pointing correctly, but I’m getting the

{"error":"unauthorized"}

Any ideas?
Thanks

#5

That’s what you’re supposed to see, assuming you’re just pointing a web browser at that address :slight_smile: