Dockerfile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. FROM node:20.2.0-alpine
  2. ENV NODE_ENV production
  3. RUN apk add --update --no-cache \
  4. openssl \
  5. curl \
  6. bash \
  7. py3-pip
  8. RUN pip install --no-cache-dir --upgrade supervisor
  9. RUN mkdir -p /var/lib/server/logs
  10. COPY docker/supervisord.conf /etc/supervisord.conf
  11. COPY docker/docker-entrypoint.sh /usr/local/bin/
  12. COPY . /opt/server
  13. WORKDIR /opt/server
  14. RUN corepack enable
  15. RUN yarn install --immutable
  16. RUN CI=true yarn build
  17. RUN mkdir -p \
  18. /opt/bundled/syncing-server \
  19. /opt/bundled/auth \
  20. /opt/bundled/files \
  21. /opt/bundled/revisions \
  22. /opt/bundled/api-gateway \
  23. /opt/shared/uploads
  24. RUN yarn workspace @standardnotes/syncing-server bundle --no-compress --output-directory /opt/bundled/syncing-server
  25. RUN yarn workspace @standardnotes/auth-server bundle --no-compress --output-directory /opt/bundled/auth
  26. RUN yarn workspace @standardnotes/files-server bundle --no-compress --output-directory /opt/bundled/files
  27. RUN yarn workspace @standardnotes/revisions-server bundle --no-compress --output-directory /opt/bundled/revisions
  28. RUN yarn workspace @standardnotes/api-gateway bundle --no-compress --output-directory /opt/bundled/api-gateway
  29. WORKDIR /opt/bundled
  30. RUN rm -rf /opt/server
  31. ENTRYPOINT ["docker-entrypoint.sh"]