Getting local development running again
This commit is contained in:
parent
9eb7747c45
commit
23853455f4
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -14,3 +14,7 @@ app/cake_eclipse_helper.php
|
|||
app/webroot/pdf/*
|
||||
app/webroot/attachments_files/*
|
||||
backups/*
|
||||
|
||||
# Go binaries
|
||||
go/server
|
||||
go/vault
|
||||
|
|
|
|||
27
Dockerfile.local.go
Normal file
27
Dockerfile.local.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
FROM golang:1.24-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy go.mod and go.sum first
|
||||
COPY go/go.mod go/go.sum ./
|
||||
|
||||
# Download dependencies
|
||||
RUN go mod download
|
||||
|
||||
# Install Air for hot reload (pinned to v1.52.3 for Go 1.24 compatibility)
|
||||
RUN go install github.com/air-verse/air@v1.52.3
|
||||
# Install sqlc for SQL code generation
|
||||
RUN go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
|
||||
|
||||
# Copy source code
|
||||
COPY go/ .
|
||||
|
||||
# Generate sqlc code
|
||||
RUN sqlc generate
|
||||
|
||||
# Copy Air config
|
||||
COPY go/.air.toml .air.toml
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["air", "-c", ".air.toml"]
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
# Database configuration
|
||||
DB_HOST=db
|
||||
DB_PORT=3306
|
||||
DB_USER=cmc
|
||||
DB_PASSWORD=xVRQI&cA?7AU=hqJ!%au
|
||||
DB_NAME=cmc
|
||||
|
||||
# Root database password (for dbshell-root)
|
||||
DB_ROOT_PASSWORD=secureRootPassword
|
||||
|
||||
# Server configuration
|
||||
PORT=8080
|
||||
40
go/.gitignore
vendored
40
go/.gitignore
vendored
|
|
@ -1,40 +0,0 @@
|
|||
# Binaries
|
||||
bin/
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
*.test
|
||||
|
||||
# Output of the go coverage tool
|
||||
*.out
|
||||
|
||||
# Go vendor directory
|
||||
vendor/
|
||||
|
||||
# Environment files
|
||||
.env
|
||||
|
||||
# Generated sqlc files (optional - you may want to commit these)
|
||||
# internal/cmc/db/*.go
|
||||
|
||||
# IDE specific files
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# OS specific files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Goose database migration config
|
||||
goose.env
|
||||
|
||||
# Gmail OAuth credentials - NEVER commit these!
|
||||
credentials.json
|
||||
token.json
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# Dev Dockerfile for Go hot reload with Air and sqlc
|
||||
FROM golang:1.24.0
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install Air for hot reload
|
||||
RUN go install github.com/air-verse/air@latest
|
||||
# Install sqlc for SQL code generation
|
||||
RUN go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
|
||||
|
||||
# Copy source code
|
||||
COPY go-app/ .
|
||||
|
||||
# Generate sqlc code
|
||||
RUN sqlc generate
|
||||
|
||||
# Copy Air config
|
||||
COPY go-app/.air.toml .air.toml
|
||||
COPY go-app/.env.example .env
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["air", "-c", ".air.toml"]
|
||||
|
|
@ -83,7 +83,7 @@ else
|
|||
echo -e "${YELLOW}🏥 Checking service health...${NC}"
|
||||
|
||||
# Check database
|
||||
if docker compose exec -T db mysqladmin ping -h localhost -u cmc -p'xVRQI&cA?7AU=hqJ!%au' --silent; then
|
||||
if docker compose exec -T db mariadb-admin ping -h localhost -u cmc -p'xVRQI&cA?7AU=hqJ!%au' --silent; then
|
||||
echo -e "${GREEN}✅ Database is ready${NC}"
|
||||
else
|
||||
echo -e "${RED}❌ Database is not ready${NC}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue