diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b03f3f4 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +.PHONY: dev install + +dev: + @echo "Starting development server..." + go run main.go + +install: + @echo "Installing dependencies..." + go mod tidy + go get -u gopkg.in/gomail.v2 + @echo "Build complete. Run with: go run main.go" diff --git a/contact-scrape-test/Dockerfile b/contact-scrape-test/Dockerfile index e28c095..f8c9dec 100644 --- a/contact-scrape-test/Dockerfile +++ b/contact-scrape-test/Dockerfile @@ -45,11 +45,11 @@ RUN mkdir -p data && chown -R appuser:appgroup /app USER appuser # Expose port -EXPOSE 8080 +EXPOSE 80 # Health check HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD wget --no-verbose --tries=1 --spider http://localhost:8080/ || exit 1 + CMD wget --no-verbose --tries=1 --spider http://localhost:80/ || exit 1 # Run the application CMD ["./contact-scrape"] \ No newline at end of file diff --git a/contact-scrape-test/Makefile b/contact-scrape-test/Makefile index 6043f99..3370087 100644 --- a/contact-scrape-test/Makefile +++ b/contact-scrape-test/Makefile @@ -5,7 +5,7 @@ # Variables BINARY_NAME=contact-scrape BUILD_DIR=build -PORT=8080 +PORT=80 help: ## Show this help message @echo "Available commands:" diff --git a/contact-scrape-test/contact-scrape.service b/contact-scrape-test/contact-scrape.service index ff60678..954aa48 100644 --- a/contact-scrape-test/contact-scrape.service +++ b/contact-scrape-test/contact-scrape.service @@ -9,7 +9,7 @@ WorkingDirectory=/opt/contact-scrape ExecStart=/opt/contact-scrape/contact-scrape Restart=always RestartSec=5 -Environment=PORT=8080 +Environment=PORT=80 # Security settings NoNewPrivileges=true diff --git a/main.go b/main.go index a287b19..fed7ed8 100644 --- a/main.go +++ b/main.go @@ -33,6 +33,171 @@ type GeoCoords struct { Lng string `json:"lng"` } +type Contact struct { + Name string `json:"name"` + Position string `json:"position"` + Phone string `json:"phone"` + ServicePhone string `json:"service_phone"` + Table int `json:"table"` +} + +func getEmbeddedHTML() string { + return ` + +
+ + +