Skip to content
Snippets Groups Projects
Dockerfile 284 B
Newer Older
  • Learn to ignore specific revisions
  • # Stage 0, based on Node.js
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    FROM node:12.16-slim
    
    
    WORKDIR /app
    
    # Copy the package.json file first in order to cache the modules
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    COPY . .
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    RUN mkdir api
    RUN cp routes.json ./api
    
    
    # Install npm dependencies
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    RUN npm install
    
    
    # expose port 3000
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    EXPOSE 80 3000
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    CMD ["npm", "run", "api"]