init
This commit is contained in:
@@ -49,6 +49,17 @@ show_help() {
|
||||
build_image() {
|
||||
log_info "Building apskel-pos-backend Docker image..."
|
||||
|
||||
# Check if Go build works locally first (optional quick test)
|
||||
if command -v go &> /dev/null; then
|
||||
log_info "Testing Go build locally first..."
|
||||
if go build -o /tmp/test-build cmd/server/main.go 2>/dev/null; then
|
||||
log_success "Local Go build test passed"
|
||||
rm -f /tmp/test-build
|
||||
else
|
||||
log_warning "Local Go build test failed, but continuing with Docker build..."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Build the image with production target
|
||||
docker build \
|
||||
--target production \
|
||||
@@ -60,6 +71,7 @@ build_image() {
|
||||
log_success "Docker image built successfully!"
|
||||
else
|
||||
log_error "Failed to build Docker image"
|
||||
log_info "Make sure you're using Go 1.21+ and all dependencies are available"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user