Skip to content

Commit 531f250

Browse files
committed
feat: add git packet capture wrapper to localgit, docs + Dockerfile enhancements
1 parent 7738585 commit 531f250

File tree

10 files changed

+1080
-21
lines changed

10 files changed

+1080
-21
lines changed

Dockerfile

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,17 @@ USER root
55

66
WORKDIR /app
77

8-
# Copy package files
9-
COPY package*.json ./
10-
11-
# Install all dependencies (including dev dependencies for building)
12-
RUN npm pkg delete scripts.prepare && npm ci --include=dev
13-
14-
# Copy source files and config files needed for build
15-
COPY tsconfig.json tsconfig.publish.json proxy.config.json config.schema.json integration-test.config.json vite.config.ts index.html index.ts ./
8+
COPY tsconfig.json tsconfig.publish.json proxy.config.json config.schema.json integration-test.config.json vite.config.ts package*.json index.html index.ts ./
169
COPY src/ /app/src/
1710
COPY public/ /app/public/
1811

1912
# Build the UI and server
20-
RUN npm run build-ui \
13+
RUN npm pkg delete scripts.prepare \
14+
&& npm ci --include=dev \
15+
&& npm run build-ui -dd \
2116
&& npx tsc --project tsconfig.publish.json \
22-
&& cp config.schema.json dist/
23-
24-
# Prune dev dependencies after build is complete
25-
RUN npm prune --omit=dev
17+
&& cp config.schema.json dist/ \
18+
&& npm prune --omit=dev
2619

2720
# Production stage
2821
FROM node:20-slim AS production
@@ -33,15 +26,10 @@ RUN apt-get update && apt-get install -y \
3326

3427
WORKDIR /app
3528

36-
# Copy the modified package.json (without prepare script) and production node_modules from builder
3729
COPY --from=builder /app/package*.json ./
3830
COPY --from=builder /app/node_modules/ /app/node_modules/
39-
40-
# Copy built artifacts from builder stage
4131
COPY --from=builder /app/dist/ /app/dist/
4232
COPY --from=builder /app/build /app/dist/build/
43-
44-
# Copy configuration files needed at runtime
4533
COPY proxy.config.json config.schema.json ./
4634

4735
# Copy entrypoint script

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ services:
3333

3434
git-server:
3535
build: localgit/
36+
ports:
37+
- '8080:8080' # Add this line to expose the git server
3638
environment:
3739
- GIT_HTTP_EXPORT_ALL=true
3840
networks:

localgit/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,21 @@ FROM httpd:2.4
33
RUN apt-get update && apt-get install -y \
44
git \
55
apache2-utils \
6+
python3 \
67
&& rm -rf /var/lib/apt/lists/*
78

89
COPY httpd.conf /usr/local/apache2/conf/httpd.conf
10+
COPY git-capture-wrapper.py /usr/local/bin/git-capture-wrapper.py
911

1012
RUN htpasswd -cb /usr/local/apache2/conf/.htpasswd admin admin123 \
1113
&& htpasswd -b /usr/local/apache2/conf/.htpasswd testuser user123
1214

1315
COPY init-repos.sh /usr/local/bin/init-repos.sh
1416

1517
RUN chmod +x /usr/local/bin/init-repos.sh \
18+
&& chmod +x /usr/local/bin/git-capture-wrapper.py \
19+
&& mkdir -p /var/git-captures \
20+
&& chown www-data:www-data /var/git-captures \
1621
&& /usr/local/bin/init-repos.sh
1722

1823
EXPOSE 8080

0 commit comments

Comments
 (0)