Skip to content

Commit

Permalink
Merge pull request #19 from create-go-app/dev
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
koddr authored May 6, 2021
2 parents 9e25e7c + 546fa2c commit 121d666
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ JWT_SECRET_KEY="secret"
JWT_REFRESH_KEY="refresh"

# Database settings:
DB_HOST="localhost"
DB_HOST="cgapp-postgres"
DB_PORT=5432
DB_USER="postgres"
DB_PASSWORD="password"
Expand Down
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,5 @@ FROM scratch
# Copy binary and config files from /build to root folder of scratch container.
COPY --from=builder ["/build/apiserver", "/build/.env", "/"]

# Export necessary port.
EXPOSE 5000

# Command to run when starting the container.
ENTRYPOINT ["/apiserver"]
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
APP_NAME = apiserver
BUILD_DIR = $(PWD)/build
MIGRATIONS_FOLDER = $(PWD)/platform/migrations
DATABASE_URL = postgres://postgres:password@localhost/postgres?sslmode=disable
DATABASE_URL = postgres://postgres:password@cgapp-postgres/postgres?sslmode=disable

clean:
rm -rf ./build
Expand Down Expand Up @@ -42,18 +42,18 @@ docker.network:
docker.run: docker.network docker.postgres swag docker.net_http migrate.up

docker.stop:
docker stop dev-net_http dev-postgres
docker stop cgapp-net_http cgapp-postgres

docker.net_http: docker.build
docker run --rm -d \
--name dev-net_http \
--name cgapp-net_http \
--network dev-network \
-p 5000:5000 \
net_http-go-template

docker.postgres:
docker run --rm -d \
--name dev-postgres \
--name cgapp-postgres \
--network dev-network \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=password \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ make docker.run
| [jackc/pgx](https://github.com/jackc/pgx) | `v4.11.0` | database |
| [swaggo/swag](https://github.com/swaggo/swag) | `v1.7.0` | utils |
| [google/uuid](https://github.com/google/uuid) | `v1.2.0` | utils |
| [go-playground/validator](https://github.com/go-playground/validator) | `v10.5.0` | utils |
| [go-playground/validator](https://github.com/go-playground/validator) | `v10.6.0` | utils |

## 🗄 Template structure

Expand Down Expand Up @@ -97,7 +97,7 @@ JWT_SECRET_KEY="secret"
JWT_REFRESH_KEY="refresh"

# Database settings:
DB_HOST="localhost"
DB_HOST="cgapp-postgres"
DB_PORT=5432
DB_USER="postgres"
DB_PASSWORD="password"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/auth0/go-jwt-middleware v1.0.0
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/go-playground/validator/v10 v10.5.0
github.com/go-playground/validator/v10 v10.6.0
github.com/google/uuid v1.2.0
github.com/gorilla/mux v1.8.0
github.com/jackc/pgx/v4 v4.11.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8c
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
github.com/go-playground/validator/v10 v10.5.0 h1:X9rflw/KmpACwT8zdrm1upefpvdy6ur8d1kWyq6sg3E=
github.com/go-playground/validator/v10 v10.5.0/go.mod h1:xm76BBt941f7yWdGnI2DVPFFg1UK3YY04qifoXU3lOk=
github.com/go-playground/validator/v10 v10.6.0 h1:UGIt4xR++fD9QrBOoo/ascJfGe3AGHEB9s6COnss4Rk=
github.com/go-playground/validator/v10 v10.6.0/go.mod h1:xm76BBt941f7yWdGnI2DVPFFg1UK3YY04qifoXU3lOk=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/create-go-app/net_http-go-template/pkg/utils"
"github.com/gorilla/mux"

_ "github.com/create-go-app/net_http-go-template/docs" //
_ "github.com/create-go-app/net_http-go-template/docs" // load Swagger docs
_ "github.com/joho/godotenv/autoload" // load .env file automatically
)

Expand Down

0 comments on commit 121d666

Please sign in to comment.