-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Moved the mysql environment required for standalone operation to docker-compose. * DockerFileの追加 * add docker ignore
- Loading branch information
1 parent
86e9fa1
commit c51ecc1
Showing
5 changed files
with
27 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
**/.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
FROM mysql:8.0.20 | ||
FROM golang:1.14.0-buster as builder | ||
WORKDIR /go | ||
COPY ./ . | ||
RUN export GOPATH= && go mod download && go build -o /go/ -v -ldflags '-s -w' ./cmd/kamimai | ||
|
||
ENV MYSQL_USER kamimai | ||
ENV MYSQL_PASSWORD kamimai | ||
ENV MYSQL_DATABASE kamimai | ||
ENV MYSQL_ROOT_PASSWORD root | ||
ENV MYSQL_HOST 127.0.0.1 | ||
ENV MYSQL_PORT 3306 | ||
FROM gcr.io/distroless/base | ||
COPY --from=builder go/kamimai . | ||
ENTRYPOINT ["/kamimai"] | ||
CMD ["--help"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: '2' | ||
services: | ||
mysql: | ||
image: mysql:8.0.20 | ||
environment: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: "yes" | ||
MYSQL_USER: kamimai | ||
MYSQL_PASSWORD: kamimai | ||
MYSQL_DATABASE: kamimai | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_HOST: 127.0.0.1 | ||
MYSQL_PORT: 3306 | ||
ports: | ||
- "3306:3306" |