Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "Corteza Dev",
"dockerComposeFile": [
"../docker-compose.dev.yaml"
],
"service": "corteza",
"workspaceFolder": "/workspace",
"overrideCommand": false,
"customizations": {
"vscode": {
"extensions": [
"golang.go",
"vue.volar",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"editorconfig.editorconfig"
],
"settings": {
"go.toolsManagement.autoUpdate": false,
"go.useLanguageServer": true,
"go.lintTool": "staticcheck",
"go.lintOnSave": "package",
"go.formatTool": "goimports",
"[go]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
},
"[vue]": {
"editor.defaultFormatter": "Vue.volar"
},
"editor.formatOnSave": true,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1000
}
}
},
"portsAttributes": {
"8000": {
"label": "Corteza Server",
"onAutoForward": "notify"
},
"5432": {
"label": "PostgreSQL",
"onAutoForward": "ignore"
},
"6379": {
"label": "Redis",
"onAutoForward": "ignore"
}
},
"remoteUser": "root",
"runArgs": [
"--network=corteza-dev"
]
}
31 changes: 31 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Git
.gitignore

# IDE
.idea
.vscode
*.iml
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*

# Node_modules - the main cause of 4.55GB build context!
# These get reinstalled inside the container
**/node_modules
**/node_modules/**/*

# OS
.DS_Store
Thumbs.db

# Docker files (not needed in build context)
Dockerfile
Dockerfile.*
docker-compose*
.dockerignore

# Logs
*.log
logs/
79 changes: 79 additions & 0 deletions .env.docker.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Corteza Development Environment Variables
# Copy this to .env.docker.dev and modify as needed

# ===========================================
# Core Settings
# ===========================================
NODE_ENV=development
ENVIRONMENT=dev
LOCALE_DEVELOPMENT_MODE=true
DEBUG=true
LOG_LEVEL=debug

HTTP_WEBAPP_ENABLED=true
HTTP_ADDR=localhost:8000
DOMAIN_WEBAPP=localhost:8000
DOMAIN=localhost:8000
# ===========================================
# Server Configuration
# ===========================================
#HTTP_ADDR=0.0.0.0:8000
CORTEZA_SERVER_URL=http://host.docker.internal:8000

# ===========================================
# Database Configuration (PostgreSQL)
# ===========================================
DATABASE_URL=postgresql://corteza:corteza@postgres:5432/corteza?sslmode=disable

# ===========================================
# Redis Configuration
# ===========================================
REDIS_URL=redis://redis:6379

# ===========================================
# Authentication & Security
# ===========================================
AUTH_SECRET=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6
JWT_SECRET=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6
JWT_ALG=HS256

# ===========================================
# Storage
# ===========================================
STORAGE_PATH=/data

# ===========================================
# Corredor (Automation)
# ===========================================
CORREDOR_ADDR=corredor:80
CORREDOR_ENABLED=false

# ===========================================
# Queue
# ===========================================
QUEUE_TYPE=redis
QUEUE_URL=redis://redis:6379

# ===========================================
# Cache
# ===========================================
CACHE_TYPE=redis
CACHE_URL=redis://redis:6379

# ===========================================
# Email / SMTP
# ===========================================
SMTP_HOST=host.docker.internal
SMTP_PORT=1025
SMTP_FROM="Corteza Dev <noreply@localhost>"

# ===========================================
# Feature Flags
# ===========================================
DISCOVERY_ENABLED=true
FEDERATION_ENABLED=true

# ===========================================
# Gin (Hot Reload) Configuration
# ===========================================
GIN_LADDR=0.0.0.0
78 changes: 78 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Dev Container for Corteza - Full Stack Development
# Ubuntu 22.04 with Go, Node.js, and all required dependencies

FROM ubuntu:22.04

# Avoid interactive prompts
ENV DEBIAN_FRONTEND=noninteractive

# Set environment variables
ENV GOPATH=/root/go
ENV PATH=/usr/local/go/bin:/root/go/bin:$PATH
ENV CGO_ENABLED=1
ENV GOFLAGS=-trimpath

# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
wget \
git \
build-essential \
gcc \
g++ \
make \
pkg-config \
libpq-dev \
libsqlite3-dev \
libmysqlclient-dev \
libssl-dev \
libcairo2-dev \
libpango1.0-dev \
libjpeg-dev \
libgif-dev \
librsvg2-dev \
&& rm -rf /var/lib/apt/lists/*

# Install Go 1.24.1
RUN wget -q https://go.dev/dl/go1.24.1.linux-amd64.tar.gz && \
rm -rf /usr/local/go && \
tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz && \
rm go1.24.1.linux-amd64.tar.gz

RUN go version

# Install Node.js 22.x
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/*

RUN node --version && npm --version

# Install Yarn globally
RUN npm install -g yarn

# Install Dart Sass 1.85.1
RUN wget -q https://github.com/sass/dart-sass/releases/download/1.85.1/dart-sass-1.85.1-linux-x64.tar.gz && \
tar -xzf dart-sass-1.85.1-linux-x64.tar.gz -C /opt/ && \
rm dart-sass-1.85.1-linux-x64.tar.gz && \
ln -s /opt/dart-sass/sass /usr/local/bin/sass

# Install essential Go tools for development (one at a time to avoid conflicts)
RUN go install github.com/codegangsta/gin@latest || true
RUN go install github.com/golang/mock/mockgen@latest || true
RUN go install honnef.co/go/tools/cmd/staticcheck@latest || true
RUN go install github.com/golang/protobuf/protoc-gen-go@latest || true
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest || true
RUN go install github.com/goware/statik@latest || true

# CUE has version conflicts - install separately
RUN go install cuelang.org/go/cmd/cue@v0.5.0 || true

# Working directory
WORKDIR /workspace

# Expose ports
EXPOSE 8000 5432 6379

# Default shell
CMD ["/bin/bash"]
Loading