Skip to content

Commit 1658fcd

Browse files
committed
general refactor
1 parent b8e23c8 commit 1658fcd

File tree

14 files changed

+1473
-147
lines changed

14 files changed

+1473
-147
lines changed

Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
FROM golang:1.21.0-bookworm
22
WORKDIR /app
3-
COPY go.mod ./
4-
COPY go.sum ./
5-
COPY . /app
3+
COPY go.mod go.sum ./
64
RUN go mod download
5+
COPY . .
76
RUN go mod vendor
8-
EXPOSE 8001
7+
RUN go install github.com/swaggo/swag/cmd/swag@latest
8+
RUN swag init -g ./cmd/server/main.go -o ./docs
99
RUN CGO_ENABLED=1 go build -o bin/server cmd/server/main.go
1010
CMD ./bin/server

Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ setup:
88
build:
99
docker compose build --no-cache
1010

11+
run-local:
12+
docker start dockerPostgres
13+
docker start dockerRedis
14+
export REDIS_HOST=localhost
15+
export POSTGRES_DB=go_app_dev
16+
export POSTGRES_USER=docker
17+
export POSTGRES_PASSWORD=password
18+
export POSTGRES_PORT=5435
19+
export JWT_SECRET_KEY=ObL89O3nOSSEj6tbdHako0cXtPErzBUfq8l8o/3KD9g=INSECURE
20+
export API_SECRET_KEY=cJGZ8L1sDcPezjOy1zacPJZxzZxrPObm2Ggs1U0V+fE=INSECURE
21+
export POSTGRES_HOST=localhost
22+
go run cmd/server/main.go
23+
1124
up:
1225
docker compose up
1326

0 commit comments

Comments
 (0)