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

build docker in stages #62

Merged
merged 2 commits into from
Dec 23, 2022
Merged
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
26 changes: 24 additions & 2 deletions parse/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
FROM parseplatform/parse-server:latest
############################################################
# Build stage
############################################################
FROM parseplatform/parse-server:latest AS build

# Install necessary dependencies and setup folders a root
USER root
RUN apk --no-cache add bash postgresql-client
RUN apk --no-cache add git
RUN npm install --omit=dev netreconlab/parse-server-carekit#main parse-server-any-analytics-adapter@^1.x.x @analytics/google-analytics@^1.x.x @analytics/google-analytics-v3@^0.x.x
RUN npm install --force --omit=dev @parse/s3-files-adapter@^1.x.x parse-server-api-mail-adapter@^2.x.x mailgun.js@^8.x.x
RUN npm install --force --omit=dev parse-hipaa-dashboard@^1.x.x clamscan@^2.x.x newrelic@^9.x.x
RUN npm install --omit=dev pm2@^5.x.x -g

############################################################
# Release stage
############################################################
FROM parseplatform/parse-server:latest AS release

# Start parse-hipaa setup as root
USER root

# Install apps needed for image
RUN apk --no-cache add bash postgresql-client

# Setup directories
RUN mkdir ./files
COPY ./scripts/ ./scripts/
RUN chmod +x ./scripts/wait-for-postgres.sh ./scripts/parse_idempotency_delete_expired_records.sh ./scripts/setup-dbs.sh ./scripts/setup-parse-index.sh ./scripts/setup-pgaudit.sh
RUN chown -R node ./files ./scripts

# Complete parse-hipaa setup as node
USER node

# Copy production node_modules
COPY --from=build /parse-server/node_modules /parse-server/node_modules
COPY --from=build /parse-server/package*.json /parse-server/

# Copy any files/scripts needed
COPY ./ecosystem.config.js ./
COPY ./process.yml ./
COPY ./index.js ./
Expand Down