Dockerfile
# Use an official Node runtime as a parent imageFROM node:11.15 AS builder # Copy the current directory contents into the container at /appCOPY ./frontend /app/frontendCOPY ./backend /app/backend # Compile the frontendWORKDIR /app/frontendRUN ["npm", "i"]RUN ["npm", "run", "build"] # Compile the backendWORKDIR /app/backendRUN ["npm", "i"]RUN ["npm", "run", "build"] # Switch to the final stage of the buildFROM node:11.15 # Copy the compiled frontend to the final stageCOPY --from=builder /app/frontend/dist /app/frontend/dist # Copy the fompiled backend to the final stageCOPY --from=builder /app/backend/dist /app/backend/distCOPY --from=builder /app/backend/node_modules /app/backend/node_modules # Make both the HTTP and HTTPS ports availableEXPOSE 80EXPOSE 443 # Prepare the JWT key pairVOLUME [ "/app/jwt" ] # Don't use SSLENV EDM_SSL false # Define the DB connectionENV EDM_DB_HOST 127.0.0.1ENV EDM_DB_DB edmENV EDM_DB_USER edmENV EDM_DB_PORT 5432ENV EDM_DB_PWD edmENV EDM_DB_SSL falseENV EDM_DB_SCHEMA edm # Define JWTENV EDM_JWT_PRIVATE_KEY /app/jwt/jwtRS256.keyENV EDM_JWT_PUBLIC_KEY /app/jwt/jwtRS256.key.pub # Configure the container startWORKDIR /app/backend/distCMD ["node", "."]