Skip to content

Latest commit

 

History

History
44 lines (28 loc) · 1.15 KB

README.md

File metadata and controls

44 lines (28 loc) · 1.15 KB

pixlet-docker

A dockerfile for Tidbyt Pixlet

This allows you to develop pixlet apps in any host OS, then render and serve those apps within this container.

Uses official golang base image and installs npm 16 specifically.

Build

docker build --no-cache -t pixlet  .

Run

docker run --rm -it -p 8080:8080 pixlet

Serving pixlet from within the container

By default pixlet serves on 127.0.0.1, to expose this to the host container we must change the host IP to 0.0.0.0.

pixlet serve examples/sunrise.star -i 0.0.0.0

Navigate to localhost:8080 on your host machine.

All-in-one Example

If you are developing a tidbyt pixlet app in a local folder, you can run this container and serve it automatically to port 8080, automatically refreshing with local changes:

Windows

docker run --rm -it -p 8080:8080 -v C:\src\pixlet-docker\examples:/srv pixlet pixlet serve -i 0.0.0.0 -w /srv/sports_scores.star

Linux

docker run --rm -it -p 8080:8080 -v /usr/src/pixlet-docker/examples:/srv pixlet pixlet serve -i 0.0.0.0 -w /srv/sports_scores.star