# grab the image
docker pull quay.io/goswagger/swagger
# for mac and linux
alias swagger='docker run --rm -it --user $(id -u):$(id -g) -e GOPATH=$(go env GOPATH):/go -v $HOME:$HOME -w $(pwd) quay.io/goswagger/swagger'
build server api
swagger generate server -A $APP_NAME -f ./schema/swagger.yml
build client api
swagger generate client -A $APP_NAME -f ./schema/swagger.yml
install dependencies
go get -u -f ./...
run program
make build && ./main --port=$APP_PORT
or
go run cmd/$APP_NAME-server/main.go --port=$APP_PORT
build docker image
cp .env.template .env
make build-container
run docker image
make run-container
delete docker container
make stop-container
run localhost
make localhost
Second part:
Create environment for web3 development:
docker-compose up -d --build or make dapp-build
docker exec -it truffle sh -c cd init && truffle compile
docker exec -it truffle sh -c cd init && truffle migrate --reset
docker exec -it truffle sh -c cd init && npm run dev
Using ethereum/solc
docker run -v $(pwd)/dapp/src/truffle:/sources ethereum/solc:stable -o /sources/election/output/contracts/ --abi --bin /sources/election/contracts/Election.sol