File tree Expand file tree Collapse file tree 7 files changed +11
-14
lines changed Expand file tree Collapse file tree 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"
88JWT_REFRESH_KEY = " refresh"
99
1010# Database settings:
11- DB_HOST = " localhost "
11+ DB_HOST = " cgapp-postgres "
1212DB_PORT = 5432
1313DB_USER = " postgres"
1414DB_PASSWORD = " password"
Original file line number Diff line number Diff line change @@ -19,8 +19,5 @@ FROM scratch
1919# Copy binary and config files from /build to root folder of scratch container.
2020COPY --from=builder ["/build/apiserver" , "/build/.env" , "/" ]
2121
22- # Export necessary port.
23- EXPOSE 5000
24-
2522# Command to run when starting the container.
2623ENTRYPOINT ["/apiserver" ]
Original file line number Diff line number Diff line change 33APP_NAME = apiserver
44BUILD_DIR = $(PWD ) /build
55MIGRATIONS_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
77
88clean :
99 rm -rf ./build
@@ -42,18 +42,18 @@ docker.network:
4242docker.run : docker.network docker.postgres swag docker.net_http migrate.up
4343
4444docker.stop :
45- docker stop dev -net_http dev -postgres
45+ docker stop cgapp -net_http cgapp -postgres
4646
4747docker.net_http : docker.build
4848 docker run --rm -d \
49- --name dev -net_http \
49+ --name cgapp -net_http \
5050 --network dev-network \
5151 -p 5000:5000 \
5252 net_http-go-template
5353
5454docker.postgres :
5555 docker run --rm -d \
56- --name dev -postgres \
56+ --name cgapp -postgres \
5757 --network dev-network \
5858 -e POSTGRES_USER=postgres \
5959 -e POSTGRES_PASSWORD=password \
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ make docker.run
4949| [ jackc/pgx] ( https://github.com/jackc/pgx ) | ` v4.11.0 ` | database |
5050| [ swaggo/swag] ( https://github.com/swaggo/swag ) | ` v1.7.0 ` | utils |
5151| [ 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 |
5353
5454## 🗄 Template structure
5555
@@ -97,7 +97,7 @@ JWT_SECRET_KEY="secret"
9797JWT_REFRESH_KEY =" refresh"
9898
9999# Database settings:
100- DB_HOST =" localhost "
100+ DB_HOST =" cgapp-postgres "
101101DB_PORT =5432
102102DB_USER =" postgres"
103103DB_PASSWORD =" password"
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ require (
66 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
77 github.com/auth0/go-jwt-middleware v1.0.0
88 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
1010 github.com/google/uuid v1.2.0
1111 github.com/gorilla/mux v1.8.0
1212 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
101101git.colasdn.top/go-playground/locales v0.13.0 /go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8 =
102102git.colasdn.top/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no =
103103git.colasdn.top/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 =
106106git.colasdn.top/go-sql-driver/mysql v1.4.0 /go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w =
107107git.colasdn.top/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs =
108108git.colasdn.top/go-sql-driver/mysql v1.5.0 /go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg =
Original file line number Diff line number Diff line change 66 "github.com/create-go-app/net_http-go-template/pkg/utils"
77 "github.com/gorilla/mux"
88
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
1010 _ "github.com/joho/godotenv/autoload" // load .env file automatically
1111)
1212
You can’t perform that action at this time.
0 commit comments