Skip to content
Open
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
40 changes: 40 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Git
.git
.gitignore

# Build outputs
**/bin/
**/obj/
**/out/

# Test results
TestResults/
*.trx
*.coverage

# IDE files
.vs/
.vscode/
*.user
*.suo

# OS generated files
.DS_Store
Thumbs.db

# Temporary files
*.tmp
*.temp

# Documentation (not needed in container)
docs/
README.md
*.md

# Local data directories
data/
*.db
*.sqlite

# Logs
*.log
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Parsing/TSqlLexer.interp
Parsing/TSqlLexer.tokens
Parsing/TSqlParser.interp
Parsing/TSqlParser.tokens

## due to takekazuomi: https://gist.github.com/takekazuomi/10955889

Expand Down Expand Up @@ -142,4 +146,10 @@ _NCrunch*
# Visual Studio temp something
.vs/

Parsing/.antlr
Parsing/.antlr

# Auto-generated Antlr4 C# files
Parsing/TSqlLexer.cs
Parsing/TSqlParser.cs
Parsing/TSqlParserBaseListener.cs
Parsing/TSqlParserListener.cs
Empty file added .gitmodules
Empty file.
55 changes: 55 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Dockerfile with automatic ANTLR code generation via Antlr4BuildTasks

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build

# Install Java for Antlr4BuildTasks
RUN apt-get update && apt-get install -y openjdk-17-jre-headless && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy solution and project files
COPY *.sln ./
COPY JankSQL/*.csproj JankSQL/
COPY Parsing/*.csproj Parsing/
COPY Tests/*.csproj Tests/
COPY JankSh/*.csproj JankSh/
COPY ScratchWork/*.csproj ScratchWork/

# Restore dependencies
RUN dotnet restore JankSQL.sln

# Copy the rest of the source code
COPY . .

# Build the solution (CSharpTest.Net.Collections now comes from NuGet)
RUN dotnet build JankSQL.sln -c Release --no-restore

# Run tests (optional - comment out if you want faster builds)
# RUN dotnet test Tests/Tests.csproj -c Release --no-build --verbosity minimal

# Create runtime image
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime

WORKDIR /app

# Copy built applications from build stage
COPY --from=build /app/JankSQL/bin/Release/net8.0 ./JankSQL
COPY --from=build /app/JankSh/bin/Release/net8.0 ./JankSh

# Create directories for data persistence
RUN mkdir -p /data/btree

# Set environment variables
ENV DOTNET_ENVIRONMENT=Production

# Default to running the interactive shell
# Users can override this to run other components
ENTRYPOINT ["dotnet", "JankSh/JankSh.dll"]

# Expose any ports if needed (none specified in current implementation)
# EXPOSE 5432

# Add labels for metadata
LABEL maintainer="JankSQL Project"
LABEL description="JankSQL - A simple SQL database server implementation in C#"
LABEL version="1.0"
4 changes: 1 addition & 3 deletions JankSQL/JankSQL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
</ItemGroup>

<ItemGroup>
<Reference Include="CSharpTest.Net.Collections">
<HintPath>..\..\CSharpTest.Net.Collections\src\CSharpTest.Net.Collections\bin\net6.0\CSharpTest.Net.Collections.dll</HintPath>
</Reference>
<PackageReference Include="CSharpTest.Net.Collections" Version="14.906.1403.1082" />
</ItemGroup>

</Project>
18 changes: 5 additions & 13 deletions Parsing/Parsing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,18 @@
</PropertyGroup>

<ItemGroup>
<None Remove="TSqlLexer.g4" />
<None Remove="TSqlParser.g4" />
<PackageReference Include="Antlr4.Runtime.Standard" Version="4.12.0" />
<PackageReference Include="Antlr4BuildTasks" Version="12.8.0" />
</ItemGroup>

<ItemGroup>
<Antlr4 Include="TSqlLexer.g4">
<AntlrToolJar>C:\antlr\antlr-4.12.0-complete.jar</AntlrToolJar>
<JavaExec>C:\Program Files\Common Files\Oracle\Java\javapath\java.exe</JavaExec>
<Visitor>False</Visitor>
<Generator>MSBuild:Compile</Generator>
</Antlr4>
<Antlr4 Include="TSqlParser.g4">
<AntlrToolJar>C:\antlr\antlr-4.12.0-complete.jar</AntlrToolJar>
<JavaExec>C:\Program Files\Common Files\Oracle\Java\javapath\java.exe</JavaExec>
<Visitor>False</Visitor>
<Generator>MSBuild:Compile</Generator>
<Listener>true</Listener>
</Antlr4>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Antlr4.Runtime.Standard" Version="4.12.0" />
<PackageReference Include="Antlr4BuildTasks" Version="12.2.0" PrivateAssets="all" />
</ItemGroup>

</Project>
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
janksql:
build: .
volumes:
# Mount a volume for persistent data storage
- janksql_data:/data
stdin_open: true
tty: true

# Service for running tests
janksql-test:
build: .
container_name: janksql-test
entrypoint: ["dotnet", "test", "/app/Tests/Tests.csproj", "-c", "Release"]
volumes:
- .:/app/source:ro

volumes:
janksql_data: