Docker image of nodejs app to host static sites
- Create a fig.yml or docker-compose.yml (install docker-compose if you did not do it yet)
- Set ports parameter specifying the port to bind to port 80 of the container
- specify volumes: specifically folder for logs and folder containing static file
- run
docker-compose up -d
No need to write some server logic! It is already included in the container.
frontend:
image: bitliner/static-node-2
mem_limit: 512m
ports:
- 9001:80
volumes:
- ./public:/usr/src/app/dist
- ./logs:/usr/src/app/logs