Skip to content

Commit

Permalink
Merge pull request chartmuseum#19 from jdolitsky/local-dev-fixes
Browse files Browse the repository at this point in the history
Local dev fixes
  • Loading branch information
idobry authored Dec 2, 2018
2 parents 683946b + 2ed7242 commit f45c32a
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 54 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea/
charts/
ui
31 changes: 21 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
FROM library/golang
#
# Stage 1
#
FROM library/golang:1 as builder

# Godep for vendoring
RUN go get github.com/tools/godep

# Recompile the standard library without CGO
RUN CGO_ENABLED=0 go install -a std

ENV APP_DIR $GOPATH/src/quickstart
ENV APP_DIR $GOPATH/src/github.com/chartmuseum/ui
RUN mkdir -p $APP_DIR

# Set the entrypoint
ENTRYPOINT (cd $APP_DIR && ./quickstart)
ADD . $APP_DIR

# Compile the binary and statically link
RUN cd $APP_DIR && CGO_ENABLED=0 godep go build -ldflags '-d -w -s'

EXPOSE 8080


RUN cd $APP_DIR && \
CGO_ENABLED=0 godep go build -ldflags '-w -s' -o /chartmuseum-ui && \
cp -r views/ /views && \
cp -r static/ /static

#
# Stage 2
#
FROM alpine:3.8
RUN apk add --no-cache curl cifs-utils ca-certificates \
&& adduser -D -u 1000 chartmuseum
COPY --from=builder /chartmuseum-ui /chartmuseum-ui
COPY --from=builder /views /views
COPY --from=builder /static /static
USER 1000
ENTRYPOINT ["/chartmuseum-ui"]
2 changes: 1 addition & 1 deletion Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,26 @@ ChartMuseumUI was written in Go (Golang) with the help of Beego Framework.

## Getting Started

These instructions will get you with your very own private charts repository. You can run this on your localmachine, on cloud and basically on every machine that have docker and docker-compose installed.
These instructions will get you started with your very own private chart repository and UI.

### Usage

ChartMuseumUI using [ChartMuseum](https://github.com/helm/chartmuseum) as a backend so the best way would be to use docker-compose.
ChartMuseumUI uses [ChartMuseum](https://github.com/helm/chartmuseum) as a backend.
To get started quickly, you can build and run the app using docker-compose.

Clone this repo and run the following:

For example, the following docker-compose file is defining ChartMuseum with Amazon S3 as a storage and exposing ChartMuseumUI on port 80
```
version: '2.0'
docker-compose up
```

This will start ChartMuseumUI at [http://localhost:3000](http://localhost:3000)
and ChartMuseum at [http://localhost:8080](http://localhost:8080).
Check out the source of [docker-compose.yaml](./docker-compose.yaml) and modify for your purposes.

Here is an example docker-compose file defining ChartMuseum with Amazon S3 as a storage and exposing ChartMuseumUI on port 80:
```
version: '2.0'
services:
ui:
image: idobry/chartmuseumui:latest
Expand Down
2 changes: 1 addition & 1 deletion conf/app.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
appname = quickstart
appname = ui
httpport = 8080
runmode = dev
3 changes: 2 additions & 1 deletion controllers/chartmuseum.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package controllers
import (
"os"
"os/exec"
"quickstart/models"

"github.com/chartmuseum/ui/models"

"github.com/astaxie/beego/httplib"
"github.com/astaxie/beego/logs"
Expand Down
51 changes: 17 additions & 34 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,20 @@
version: '3.4'

version: '2.0'
services:
ui:
image: idobry/chartmuseumui:0.0.4
environment:
CHART_MUSESUM_URL: "http://chartmuseum:8080"
AUTHENTICATION: "true"
DB_HOST: postgres
DB_USER: user
DB_PASSWORD: user
DB_NAME: db
ports:
- 9090:8080

chartmuseum:
image: chartmuseum/chartmuseum:latest
volumes:
- ~/.aws:/root/.aws:ro
restart: always
environment:
ui:
build: ./
#image: idobry/chartmuseumui:latest
environment:
CHART_MUSESUM_URL: http://chartmuseum:8080
ports:
- 3000:8080
chartmuseum:
image: chartmuseum/chartmuseum:v0.7.1
ports:
- 8080:8080
volumes:
- ./charts:/charts
environment:
PORT: 8080
DEBUG: 1
STORAGE: "amazon"
STORAGE_AMAZON_BUCKET: "imisight-chartmuseum"
STORAGE_AMAZON_PREFIX: ""
STORAGE_AMAZON_REGION: "eu-west-1"
ports:
- 8080:8080

postgres:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: user
POSTGRES_USER: user
POSTGRES_DB: db
STORAGE: local
STORAGE_LOCAL_ROOTDIR: /charts
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
_ "quickstart/routers"
_ "github.com/chartmuseum/ui/routers"

"github.com/astaxie/beego"
)
Expand Down
2 changes: 1 addition & 1 deletion routers/router.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package routers

import (
"quickstart/controllers"
"github.com/chartmuseum/ui/controllers"

"github.com/astaxie/beego"
)
Expand Down
3 changes: 2 additions & 1 deletion tests/default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
"testing"
"runtime"
"path/filepath"
_ "quickstart/routers"

_ "github.com/chartmuseum/ui/routers"

"github.com/astaxie/beego"
. "github.com/smartystreets/goconvey/convey"
Expand Down

0 comments on commit f45c32a

Please sign in to comment.