-
Notifications
You must be signed in to change notification settings - Fork 3
Configure continuous delivery for the backend #1
base: master
Are you sure you want to change the base?
Conversation
RUN go mod download \ | ||
&& go mod verify \ | ||
&& go build -o build/app main.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's separate them into separate RUN
command so that we leverage Docker layer caching to avoid re downloading all dependencies when go build
command changes.
&& go mod verify \ | ||
&& go build -o build/app main.go | ||
|
||
CMD ["/app/build/app"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add multi stage build so that we don't have to package all dependencies together into production container to reduce production container size: https://github.com/short-d/app-template/blob/master/backend/Dockerfile
|
||
go 1.14 | ||
|
||
require github.com/short-d/app v0.0.0-20200627081605-eabc0539025f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are should be other indirect dependencies being added here because they are not yet using Go modules.
} | ||
|
||
routingService := service. | ||
NewRoutingBuilder("Example"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NewRoutingBuilder("Example"). | |
NewRoutingBuilder("Emotic"). |
Hi @waterhark, thank you so much for working on this PR! |
|
a simple server and ci config,docker image:))