Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendor dependencies and add Makefile & Dockerfile #6

Merged
merged 6 commits into from
Jan 9, 2017
Merged

Vendor dependencies and add Makefile & Dockerfile #6

merged 6 commits into from
Jan 9, 2017

Conversation

metalmatze
Copy link
Contributor

@metalmatze metalmatze commented Dec 25, 2016

Hey. I want to run Ana in docker on my machines. I made a few changes to be able to run Ana inside docker:

  • Create Dockerfile
  • Create a docker-compose.yml with an example setup
  • Create Makefile
    • Running make builds a binary ./ana
    • Running make clean removes ./ana and ana from $GOPATH/bin
    • Running make fmt runs go fmt on the project
    • Running make vet runs go vet on the project
    • Running make errcheck runs go errcheck on the project and downloads errcheck if not in $PATH
    • Running make lint runs golint on the project and downloads golint if not in $PATH
    • Running make test runs go test in every Go package and creates a coverage.out for code coverage e.g. with coverall or codecov
    • Running make install creates a static binary in $GOPATH/bin
    • Running make build creates a static binary ./ana
    • Running make docker creates a docker images, currently in my own namespace, you should create an organization for this project 😊
  • Don't log.Fatal if there's no .env because I want to inject config variables via env from outside the docker container and there won't be an .env
  • Vendor all Go dependencies using govendor so those are within the project.

If you have any question left please ask. I just put everything inside this one big PR. I can also split stuff apart.

EDIT: Should I update the PR with changes to README.md or put into another PR?

@dannyvankooten
Copy link
Contributor

Hey @metalmatze,

This looks awesome. Please allow me a few days to get familiar with the changes but from the first look, I absolutely love what you did here. :) I'm in Africa right now where internet is paid by the megabyte so I can't pull this in yet, but will be able to next week.

Have a great 2nd day of Christmas and year's end!

@zet4
Copy link

zet4 commented Jan 8, 2017

Consider using travis-ci to build minimal scratch images instead of using alpine as base, example can be seen here.
As well as maybe provide releases?

@dannyvankooten
Copy link
Contributor

@metalmatze How are you handling database migrations in your Docker build? Right now I see that the migrate tool is not listed among the vendored dependencies, but you are parsing the .env file for the credentials. Going forward, I think it's best to handle this from within Go anyway but just wondering how you're handling this right now.

@zet4 There'll definitely be releases but Ana is in a pretty sad (unstable) state right now. I expect things to stabilize in a few months.

@dannyvankooten dannyvankooten merged commit bf0252c into usefathom:master Jan 9, 2017
@metalmatze
Copy link
Contributor Author

Please stick with alpine as base image. Scratch is just way to less.
You can read about a discussion we had over at go-gitea/gitea about scratch vs alpine.
alpine is the de facto standard for small images with docker.

We should probably use travis as CI for this project. Unless you have a server to host drone on, which would result in much faster build times. If there's something I'd be happy to help to set it up. I just had an instance and went with it.

Regarding migrate I currently just run it from the outside in other projects. But integrating this as a cli command or even auto run migration on start would be way better user experience, I guess.

@zet4
Copy link

zet4 commented Jan 11, 2017

I don't see how gitea's conversation has any relevancy to ana, gitea needs alpine as base because it needs shell scripting capabilities for hooks and whatnot, no such thing exists in ana and I don't think there will be need for such either?

dannyvankooten added a commit that referenced this pull request Jan 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants