Skip to content

Commit

Permalink
fix: docker-compose.yaml is work, api service can communicate with po…
Browse files Browse the repository at this point in the history
…stgres without using wait-for.sh
  • Loading branch information
cukhoaimon committed Feb 12, 2024
1 parent 0f5ffe2 commit 332fa2b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ COPY start.sh .
COPY db/migration ./db/migration

EXPOSE 8080
CMD [ "/app/main" ]
ENTRYPOINT [ "/app/start.sh" ]
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
ports:
- "8080:8080"
environment:
- DB_SOURCE=${DB_SOURCE}
- DB_SOURCE=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_DRIVER}:5432/${POSTGRES_DB}?sslmode=disable
depends_on:
postgres:
condition: service_healthy
Expand Down
2 changes: 1 addition & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -e

echo "start the app"
exec "$@"
./app/main
2 changes: 1 addition & 1 deletion val/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

var (
isValidUsername = regexp.MustCompile(`^[a-zA-Z0-9_]+$`).MatchString
isValidFullName = regexp.MustCompile(`^[a-zA-Z\-\\s]+$`).MatchString
isValidFullName = regexp.MustCompile(`^[a-zA-Z\s]+$`).MatchString
)

func ValidateString(value string, min, max int) error {
Expand Down

0 comments on commit 332fa2b

Please sign in to comment.