/bit-docker

A dockerfile setup to run your own Bit server.

Primary LanguageDockerfileOtherNOASSERTION

Bit-docker

A dockerfile setup to run your own Bit server.

Getting started

  1. Clone this repository.
  2. Edit scope.json with your name (legacy, shoudl be replaced soon)
  3. Edit scope.jsonc with your description
  4. Build image and run server.
    $ docker build . -t harmony-scope
    $ docker run --rm --name my-scope -d -p 3000:3000 harmony-scope
    Note - the server will take a few minutes to spin up, so localhost:3000 wont be available immediately
  5. Configure workspace to use the server.
    $ bit remote add http://localhost:3000
  6. Add scope to workspace.jsonc
  7. Export components to a Bit server.
    $ bit export
  8. Import components from a Bit server.
    $ bit import scope.<component-name>
  9. Stop server
    $ docker kill bit

Troubleshooting

Unable to connect to server

  • See if container is running.
    $ docker ps --all | grep bit
  • Make sure the HTTP port is configured correctly.
    $ docker port bit 3000
  • See that your server is configured for your workspace.
    $ bit remote

Run bash on the container

When you need to run any command on the Bit server, you first need to get bash on the container:

$ docker exec -it bit /bin/bash

Now each command you run, runs on the server.

Tail server logs

To run the tail command and get the server's logs, you should first get bash on the container. Then tail Bit's log:

$ tail -f /root/Library/Caches/Bit/logs/debug.log

Contributing

Contributions are always welcome, no matter how large or small.

License

MIT License.