Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Dockerfile 1.9 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
  1. # This Dockerfile can be used for docker-based deployments to platforms
  2. # like Now or Moda, but it is currently _not_ used by our Heroku deployments
  3. # It uses two multi-stage builds: `install` and the main build to keep the image size down.
  4. # --------------------------------------------------------------------------------
  5. # INSTALL IMAGE
  6. # A temporary image that installs production-only dependencies and builds the production-ready front-end bundles.
  7. FROM node:14-alpine as install
  8. RUN apk add --no-cache python make g++
  9. ENV NODE_ENV production
  10. WORKDIR /usr/src/docs
  11. COPY package*.json ./
  12. COPY javascripts ./javascripts
  13. COPY stylesheets ./stylesheets
  14. COPY lib ./lib
  15. COPY webpack.config.js ./webpack.config.js
  16. RUN npm ci --production
  17. RUN npm run build
  18. # --------------------------------------------------------------------------------
  19. # MAIN IMAGE
  20. FROM node:14-alpine
  21. # Let's make our home
  22. WORKDIR /usr/src/docs
  23. # Ensure our node user owns the directory we're using
  24. RUN chown node:node /usr/src/docs -R
  25. # This should be our normal running user
  26. USER node
  27. # Copy our dependencies
  28. COPY --chown=node:node --from=install /usr/src/docs/node_modules /usr/src/docs/node_modules
  29. # Copy our front-end code
  30. COPY --chown=node:node --from=install /usr/src/docs/dist /usr/src/docs/dist
  31. # We should always be running in production mode
  32. ENV NODE_ENV production
  33. # Use Lunr instead of Algolia
  34. ENV AIRGAP true
  35. # Copy only what's needed to run the server
  36. COPY --chown=node:node assets ./assets
  37. COPY --chown=node:node content ./content
  38. COPY --chown=node:node data ./data
  39. COPY --chown=node:node includes ./includes
  40. COPY --chown=node:node layouts ./layouts
  41. COPY --chown=node:node lib ./lib
  42. COPY --chown=node:node middleware ./middleware
  43. COPY --chown=node:node translations ./translations
  44. COPY --chown=node:node server.js ./server.js
  45. COPY --chown=node:node package*.json ./
  46. COPY --chown=node:node feature-flags.json ./
  47. EXPOSE 80
  48. EXPOSE 443
  49. EXPOSE 4000
  50. CMD ["node", "server.js"]
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...