Skip to content
This repository was archived by the owner on Jan 11, 2026. It is now read-only.

Commit 6b23e59

Browse files
committed
docker
1 parent e6afcc0 commit 6b23e59

29 files changed

+5791
-986
lines changed

.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.git
2+
.gitignore
3+
.DS_Store
4+
**/bin
5+
**/obj
6+
compiler/bin
7+
compiler/obj
8+
frontend/node_modules
9+
frontend/.next
10+
frontend/out
11+
frontend/.turbo
12+
frontend/tsconfig.tsbuildinfo

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
run: make install
2121
shell: bash
2222

23-
- name: Add Bun to PATH
24-
run: echo "$HOME/.bun/bin" >> "$GITHUB_PATH"
23+
- name: Add PNPM to PATH
24+
run: echo "$HOME/.pnpm/bin" >> "$GITHUB_PATH"
2525
shell: bash
2626

2727
- name: Run tests

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Ultra Giga Compiler Pro Max 2025
1+
# MiniLang -> WASM Compiler
22

33
## Prereqs
44

55
* .NET 9 SDK
6-
* Node 18+ + Bun
6+
* Node 18+ + Pnpm
77
* wasi-sdk/wasm-tools
88

9-
Make sure `dotnet`, `npm`, `bun`, `nodemon` and `wasm-validate` are on your `$PATH`.
9+
Make sure `dotnet`, `npm`, `pnpm`, `nodemon` and `wasm-validate` are on your `$PATH`.
1010

1111
## Auto-tests
1212

compiler/wasm/WasmCompiler.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#define DEBUG_FIELD_LAYOUT
2-
31
using System.Buffers.Binary;
42
using System.Collections.Immutable;
53
using MiniLang.Syntax;

docker-compose.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
services:
2+
web:
3+
build:
4+
context: .
5+
dockerfile: docker/web.Dockerfile
6+
ports:
7+
- "3000:3000"
8+
environment:
9+
NODE_ENV: production
10+
11+
cli:
12+
build:
13+
context: .
14+
dockerfile: docker/cli.Dockerfile
15+
args:
16+
SSH_USER: dev
17+
SSH_PASSWORD: devpass
18+
ports:
19+
- "2222:22"

docker/cli-entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
exec /usr/sbin/sshd -D -e

docker/cli.Dockerfile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS base
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
RUN apt-get update \
5+
&& apt-get install -y --no-install-recommends openssh-server make unzip curl ca-certificates jq wabt git busybox-static \
6+
&& rm -rf /var/lib/apt/lists/*
7+
8+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
9+
&& apt-get update \
10+
&& apt-get install -y --no-install-recommends nodejs \
11+
&& rm -rf /var/lib/apt/lists/* \
12+
&& corepack enable \
13+
&& corepack prepare pnpm@latest --activate
14+
15+
FROM base AS builder
16+
WORKDIR /workspace
17+
COPY . .
18+
ENV NUGET_PACKAGES=/workspace/.nuget/packages
19+
RUN dotnet restore compiler/CompilersApp.csproj
20+
RUN cd frontend && pnpm install
21+
22+
FROM base AS runtime
23+
24+
ARG SSH_USER=dev
25+
ARG SSH_PASSWORD=devpass
26+
ENV SSH_USER=${SSH_USER}
27+
ENV SSH_PASSWORD=${SSH_PASSWORD}
28+
29+
RUN useradd -m -s /bin/bash "$SSH_USER" \
30+
&& echo "$SSH_USER:$SSH_PASSWORD" | chpasswd \
31+
&& mkdir -p /var/run/sshd
32+
33+
RUN ssh-keygen -A
34+
35+
RUN sed -i "s/^#\\?PasswordAuthentication .*/PasswordAuthentication yes/" /etc/ssh/sshd_config \
36+
&& sed -i "s/^#\\?PermitRootLogin .*/PermitRootLogin no/" /etc/ssh/sshd_config
37+
38+
COPY --from=builder /workspace "/home/${SSH_USER}"
39+
40+
COPY docker/cli-entrypoint.sh /usr/local/bin/cli-entrypoint.sh
41+
RUN chmod +x /usr/local/bin/cli-entrypoint.sh \
42+
&& mkdir -p /etc/profile.d \
43+
&& printf 'export PNPM_HOME=$HOME/.local/share/pnpm\nexport PATH=$PNPM_HOME:$PATH\n' >/etc/profile.d/pnpm.sh \
44+
&& chown -R "${SSH_USER}:${SSH_USER}" /home/"${SSH_USER}"
45+
46+
EXPOSE 22
47+
ENTRYPOINT ["/usr/local/bin/cli-entrypoint.sh"]

docker/web.Dockerfile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS base
2+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
3+
4+
ARG DEBIAN_FRONTEND=noninteractive
5+
RUN apt-get update \
6+
&& apt-get install -y --no-install-recommends ca-certificates curl unzip git build-essential \
7+
&& rm -rf /var/lib/apt/lists/*
8+
9+
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
10+
&& apt-get install -y --no-install-recommends nodejs \
11+
&& corepack enable \
12+
&& corepack prepare pnpm@latest --activate \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
WORKDIR /src
16+
17+
COPY frontend/package.json frontend/pnpm-lock.yaml ./frontend/
18+
RUN cd frontend && pnpm install --frozen-lockfile
19+
20+
COPY . .
21+
22+
RUN make build
23+
24+
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
25+
26+
ARG DEBIAN_FRONTEND=noninteractive
27+
RUN apt-get update \
28+
&& apt-get install -y --no-install-recommends make curl \
29+
&& rm -rf /var/lib/apt/lists/*
30+
31+
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
32+
&& apt-get install -y --no-install-recommends nodejs \
33+
&& corepack enable \
34+
&& corepack prepare pnpm@latest --activate \
35+
&& rm -rf /var/lib/apt/lists/*
36+
37+
WORKDIR /app
38+
39+
COPY Makefile ./
40+
COPY --from=build /src/frontend/.next ./frontend/.next
41+
COPY --from=build /src/frontend/public ./frontend/public
42+
COPY --from=build /src/frontend/package.json ./frontend/
43+
COPY --from=build /src/frontend/node_modules ./frontend/node_modules
44+
COPY --from=build /src/frontend/Makefile ./frontend/Makefile
45+
46+
COPY --from=build /src/compiler/bin/Release/net9.0/ /app/compiler/bin/Release/net9.0/
47+
48+
ENV NODE_ENV=production \
49+
NEXT_TELEMETRY_DISABLED=1 \
50+
COMPILER_PATH=/app/compiler/bin/Release/net9.0/CompilersApp \
51+
PORT=3000 \
52+
HOST=0.0.0.0
53+
54+
EXPOSE 3000
55+
56+
CMD ["make","start"]

frontend/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
.PHONY: build dev start
22

33
build:
4-
bun run build -- $(ARGS)
4+
pnpm run build -- $(ARGS)
55

66
dev:
7-
bun run dev -- $(ARGS)
7+
pnpm run dev -- $(ARGS)
88

99
start:
10-
bun run start -- $(ARGS)
10+
pnpm run start -- $(ARGS)

0 commit comments

Comments
 (0)