-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c06613
commit 1b02edc
Showing
7 changed files
with
61 additions
and
2 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,6 @@ | ||
.dbdata | ||
|
||
/sql | ||
|
||
README.md | ||
Makefile |
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,20 @@ | ||
FROM golang:1.17-alpine | ||
WORKDIR /app | ||
|
||
ARG TARGETARCH | ||
ARG TARGETOS | ||
|
||
ENV GOPROXY=https://goproxy.cn | ||
ENV GO111MODULE=on | ||
COPY go.mod go.mod | ||
COPY go.sum go.sum | ||
RUN go mod download | ||
|
||
COPY api/ api/ | ||
COPY cmd/ cmd/ | ||
COPY internal/ internal/ | ||
RUN CGO_ENABLED=0 GOARCH=$TARGETARCH GOOS=$TARGETOS go build -a -o server ./cmd/server/ | ||
|
||
COPY config/ config/ | ||
EXPOSE 50051 | ||
ENTRYPOINT ["./server"] |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
grpc: | ||
port: :50051 | ||
dsn: root:root@tcp(127.0.0.1:3306)/memo?charset=utf8mb4&parseTime=True&loc=Local | ||
dsn: root:root@tcp(mysql:3306)/memo?charset=utf8mb4&parseTime=True&loc=Local |
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,25 @@ | ||
version: "3.1" | ||
services: | ||
server: | ||
restart: always | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- "50051:50051" | ||
depends_on: | ||
- mysql | ||
mysql: | ||
image: "mysql:5.7" | ||
platform: "linux/x86_64" | ||
environment: | ||
MYSQL_DATABASE: memo | ||
MYSQL_ROOT_PASSWORD: root | ||
volumes: | ||
- .dbdata:/var/lib/mysql:rw | ||
# https://gist.github.com/onjin/2dd3cc52ef79069de1faa2dfd456c945#gistcomment-2163519 | ||
- ./sql/init.sql:/docker-entrypoint-initdb.d/init.sql | ||
- ./mysql_custom.cnf:/etc/mysql/conf.d/custom.cnf | ||
ports: | ||
- "3306:3306" | ||
restart: always |
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,4 @@ | ||
[mysqld] | ||
character-set-server = utf8 | ||
collation-server = utf8_unicode_ci | ||
skip-character-set-client-handshake |
File renamed without changes.