Skip to content
Snippets Groups Projects
Dockerfile 644 B
Newer Older
  • Learn to ignore specific revisions
  • Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    ARG DEPENDENCY_PROXY=
    FROM ${DEPENDENCY_PROXY}node:18.17-slim AS builder
    
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    # Set build directory
    WORKDIR /app
    
    
    # Copy the package.json file first in order to cache the modules
    COPY ./package.json .
    COPY ./yarn.lock .
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    # Copy the project
    COPY tsconfig.json .
    COPY sidebars.ts .
    COPY docusaurus.config.ts .
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    COPY /src ./src
    COPY /docs ./docs
    COPY /static ./static
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    # build the documentation site
    
    RUN yarn build
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    # Expose server port
    
    FROM nginxinc/nginx-unprivileged:1.25
    
    RUN rm -rf /etc/nginx/html/* 
    
    COPY --from=builder /app/build /usr/share/nginx/html
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    RUN ls -l /usr/share/nginx/html
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    CMD ["nginx", "-g", "daemon off;"]