File tree 7 files changed +11
-14
lines changed 7 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ JWT_SECRET_KEY="secret"
8
8
JWT_REFRESH_KEY = " refresh"
9
9
10
10
# Database settings:
11
- DB_HOST = " localhost "
11
+ DB_HOST = " cgapp-postgres "
12
12
DB_PORT = 5432
13
13
DB_USER = " postgres"
14
14
DB_PASSWORD = " password"
Original file line number Diff line number Diff line change @@ -19,8 +19,5 @@ FROM scratch
19
19
# Copy binary and config files from /build to root folder of scratch container.
20
20
COPY --from=builder ["/build/apiserver" , "/build/.env" , "/" ]
21
21
22
- # Export necessary port.
23
- EXPOSE 5000
24
-
25
22
# Command to run when starting the container.
26
23
ENTRYPOINT ["/apiserver" ]
Original file line number Diff line number Diff line change 3
3
APP_NAME = apiserver
4
4
BUILD_DIR = $(PWD ) /build
5
5
MIGRATIONS_FOLDER = $(PWD ) /platform/migrations
6
- DATABASE_URL = postgres://postgres:password@localhost /postgres?sslmode=disable
6
+ DATABASE_URL = postgres://postgres:password@cgapp-postgres /postgres?sslmode=disable
7
7
8
8
clean :
9
9
rm -rf ./build
@@ -42,18 +42,18 @@ docker.network:
42
42
docker.run : docker.network docker.postgres swag docker.net_http migrate.up
43
43
44
44
docker.stop :
45
- docker stop dev -net_http dev -postgres
45
+ docker stop cgapp -net_http cgapp -postgres
46
46
47
47
docker.net_http : docker.build
48
48
docker run --rm -d \
49
- --name dev -net_http \
49
+ --name cgapp -net_http \
50
50
--network dev-network \
51
51
-p 5000:5000 \
52
52
net_http-go-template
53
53
54
54
docker.postgres :
55
55
docker run --rm -d \
56
- --name dev -postgres \
56
+ --name cgapp -postgres \
57
57
--network dev-network \
58
58
-e POSTGRES_USER=postgres \
59
59
-e POSTGRES_PASSWORD=password \
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ make docker.run
49
49
| [ jackc/pgx] ( https://github.com/jackc/pgx ) | ` v4.11.0 ` | database |
50
50
| [ swaggo/swag] ( https://github.com/swaggo/swag ) | ` v1.7.0 ` | utils |
51
51
| [ google/uuid] ( https://github.com/google/uuid ) | ` v1.2.0 ` | utils |
52
- | [ go-playground/validator] ( https://github.com/go-playground/validator ) | ` v10.5 .0 ` | utils |
52
+ | [ go-playground/validator] ( https://github.com/go-playground/validator ) | ` v10.6 .0 ` | utils |
53
53
54
54
## 🗄 Template structure
55
55
@@ -97,7 +97,7 @@ JWT_SECRET_KEY="secret"
97
97
JWT_REFRESH_KEY =" refresh"
98
98
99
99
# Database settings:
100
- DB_HOST =" localhost "
100
+ DB_HOST =" cgapp-postgres "
101
101
DB_PORT =5432
102
102
DB_USER =" postgres"
103
103
DB_PASSWORD =" password"
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ require (
6
6
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
7
7
github.com/auth0/go-jwt-middleware v1.0.0
8
8
github.com/dgrijalva/jwt-go v3.2.0+incompatible
9
- github.com/go-playground/validator/v10 v10.5 .0
9
+ github.com/go-playground/validator/v10 v10.6 .0
10
10
github.com/google/uuid v1.2.0
11
11
github.com/gorilla/mux v1.8.0
12
12
github.com/jackc/pgx/v4 v4.11.0
Original file line number Diff line number Diff line change @@ -101,8 +101,8 @@ github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8c
101
101
github.com/go-playground/locales v0.13.0 /go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8 =
102
102
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no =
103
103
github.com/go-playground/universal-translator v0.17.0 /go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA =
104
- github.com/go-playground/validator/v10 v10.5 .0 h1:X9rflw/KmpACwT8zdrm1upefpvdy6ur8d1kWyq6sg3E =
105
- github.com/go-playground/validator/v10 v10.5 .0 /go.mod h1:xm76BBt941f7yWdGnI2DVPFFg1UK3YY04qifoXU3lOk =
104
+ github.com/go-playground/validator/v10 v10.6 .0 h1:UGIt4xR++fD9QrBOoo/ascJfGe3AGHEB9s6COnss4Rk =
105
+ github.com/go-playground/validator/v10 v10.6 .0 /go.mod h1:xm76BBt941f7yWdGnI2DVPFFg1UK3YY04qifoXU3lOk =
106
106
github.com/go-sql-driver/mysql v1.4.0 /go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w =
107
107
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs =
108
108
github.com/go-sql-driver/mysql v1.5.0 /go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg =
Original file line number Diff line number Diff line change 6
6
"github.com/create-go-app/net_http-go-template/pkg/utils"
7
7
"github.com/gorilla/mux"
8
8
9
- _ "github.com/create-go-app/net_http-go-template/docs" //
9
+ _ "github.com/create-go-app/net_http-go-template/docs" // load Swagger docs
10
10
_ "github.com/joho/godotenv/autoload" // load .env file automatically
11
11
)
12
12
You can’t perform that action at this time.
0 commit comments