Skip to content

chunghei0116/unpub-docker

Repository files navigation

Unpub

Unpub is a package repository for Dart pub packages. It supports both publishing and serving packages. Unpub is similar to pub.dartlang.org, but it is designed to be used on a private network.

Prerequisite

Plese make sure you have the following tools installed:

Quick Start (MacOS) - Local

Prepare mock Mongodb

MongoDB installation through brew:

  1. Update Homebrew and add the MongoDB tap:
brew update
brew tap mongodb/brew
  1. Install MongoDB:
brew install mongodb-community
  1. Start MongoDB as a service:
brew services start mongodb/brew/mongodb-community
  1. Verify the installation by opening the MongoDB shell:
mongosh
  1. To stop MongoDB when you're done:
brew services stop mongodb/brew/mongodb-community

Run Unpub locally

Start through VSC debug console OR via command: flutter pub run bin/unpub.dart Access at http://localhost:4000

Serving at http://0.0.0.0:4000

Quick Start - Docker

  1. Build local unpub image:
docker build -f ./Dockerfile -t unpub-image .
  1. Add the image name into the docker-compose.yml file
version: "3.3"
services:
  unpub:
    image: <unpub image name>
    container_name: unpub
  1. Run the container via:
docker compose up -d
  1. Access at http://localhost:4000

Add new package

The detail of how to write a new package is in the Flutter package guide

  1. Create a new package folder in packages folder
  2. Change directory into the new package folder
cd packagess
flutter create --template=package your_package_name
  1. Change directory into the package folder and run flutter pub get
cd your_package_name
flutter pub get

Publish package

Push the package to unpub server, you can push to your local server for testing as well

flutter pub publish --server http://0.0.0.0:4000

About

Run dcokerized Unpub

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages