Dockerfile 656 B

1234567891011121314151617181920212223242526
  1. FROM node:lts
  2. # Ensure that the ~/.ssb directory is persistent and owned by the 'node' user.
  3. RUN mkdir /home/node/.ssb && chown node:node /home/node/.ssb
  4. VOLUME /home/node/.ssb
  5. # Don't run as root.
  6. USER node
  7. # Create app directory and use it.
  8. RUN mkdir /home/node/app
  9. WORKDIR /home/node/app
  10. # Add dependency metadata and install dependencies.
  11. ADD package.json package-lock.json ./
  12. RUN npm ci
  13. # Add the rest of the source code.
  14. ADD ./ ./
  15. # Expose ports for Oasis and SSB replication.
  16. EXPOSE 3000 8008
  17. # Listen on the container's public interfaces but allow 'localhost' connections.
  18. CMD ["node", ".", "--host", "0.0.0.0", "--allow-host", "localhost"]