Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for dockerfile #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,35 @@
FROM node:boron
FROM node:18-bullseye as intermediate
ARG GIT_TOKEN
ARG BRANCH=dev
RUN apt-get update && apt-get install -y git

RUN git config --global credential.helper 'cache --timeout=3600'
RUN export GIT_ASKPASS=${GIT_TOKEN}

RUN git clone -b ${BRANCH} --recurse-submodules https://${GIT_TOKEN}:x-oauth-basic@github.com/insidemaps-org/website-v1.git

FROM node:18-bullseye

COPY --from=intermediate /website-v1 /var/www/production

WORKDIR /var/www/production

RUN apt-get update && apt-get install -y default-jdk
RUN npm install -g npm@latest

RUN echo '{"parseServerURLForNode": {"URL": "https://parse-dev.insidemaps.com/parse"}}' > ./config.json
RUN npm i


RUN npm run build-ts
RUN npm run build -ws

RUN mkdir /var/log/insideMaps
RUN chmod g+w,a+w /var/log/insideMaps
RUN mkdir /var/tmp/insideMaps
RUN mkdir /var/tmp/insideMaps/files
RUN chmod g+w,a+w /var/tmp/insideMaps/files


RUN mkdir -p /parse-server
COPY ./ /parse-server/
Expand All @@ -11,8 +42,7 @@ VOLUME /parse-server/cloud

WORKDIR /parse-server

RUN npm install && \
npm run build
RUN npm install && npm run build

ENV PORT=1337

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ $ mongodb-runner start
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test
```
***Note:*** *If installation with* `-g` *fails due to permission problems* (`npm ERR! code 'EACCES'`), *please refer to [this link](https://docs.npmjs.com/getting-started/fixing-npm-permissions).*


### Inside a Docker container
```
$ docker build --tag parse-server .
$ docker build --build-arg GIT_TOKEN=<git_token> -t parse-server . --no-cache
$ 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
```
```

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.

Expand Down Expand Up @@ -287,14 +287,14 @@ var server = ParseServer({
},
// optional settings to enforce password policies
passwordPolicy: {
// Two optional settings to enforce strong passwords. Either one or both can be specified.
// Two optional settings to enforce strong passwords. Either one or both can be specified.
// If both are specified, both checks must pass to accept the password
// 1. a RegExp object or a regex string representing the pattern to enforce
// 1. a RegExp object or a regex string representing the pattern to enforce
validatorPattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})/, // enforce password with at least 8 char with at least 1 lower case, 1 upper case and 1 digit
// 2. a callback function to be invoked to validate the password
validatorCallback: (password) => { return validatePassword(password) },
// 2. a callback function to be invoked to validate the password
validatorCallback: (password) => { return validatePassword(password) },
doNotAllowUsername: true, // optional setting to disallow username in passwords
maxPasswordAge: 90, // optional setting in days for password expiry. Login fails if user does not reset the password within this period after signup/last reset.
maxPasswordAge: 90, // optional setting in days for password expiry. Login fails if user does not reset the password within this period after signup/last reset.
maxPasswordHistory: 5, // optional setting to prevent reuse of previous n passwords. Maximum value that can be specified is 20. Not specifying it or specifying 0 will not enforce history.
//optional setting to set a validity duration for password reset links (in seconds)
resetTokenValidityDuration: 24*60*60, // expire after 24 hours
Expand Down
Loading