summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile58
1 files changed, 58 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..6ecf73f
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,58 @@
+FROM rockylinux:9
+
+# Install required packages
+RUN dnf install -y epel-release && \
+ dnf install -y \
+ tmux \
+ git \
+ nginx \
+ fcgiwrap \
+ gcc \
+ make \
+ openssl-devel \
+ zlib-devel \
+ procps-ng \
+ systemd-sysv && \
+ dnf clean all
+
+# Clone and build cgit
+RUN git clone https://git.zx2c4.com/cgit /tmp/cgit && \
+ cd /tmp/cgit && \
+ git submodule init && \
+ git submodule update && \
+ make && \
+ make install && \
+ rm -rf /tmp/cgit
+
+# Create necessary directories
+RUN mkdir -p /git /var/www/htdocs/cgit && \
+ chown -R nginx:nginx /var/www/htdocs/cgit && \
+ chgrp -R nginx /git && \
+ chmod -R g+s /git && \
+ chmod -R 775 /git
+
+# Configure cgit
+RUN touch /etc/cgitrc && \
+ chown nginx:nginx /etc/cgitrc && \
+ chgrp nginx /etc/cgitrc && \
+ chmod 664 /etc/cgitrc
+
+# Add cgit configuration
+RUN echo 'css=/cgit.css' >> /etc/cgitrc && \
+ echo 'logo=/cgit.png' >> /etc/cgitrc && \
+ echo 'virtual-root=/' >> /etc/cgitrc && \
+ echo 'cache-size=200' >> /etc/cgitrc && \
+ echo 'scan-path=/git' >> /etc/cgitrc
+
+# Configure nginx
+COPY nginx.conf /etc/nginx/nginx.conf
+
+# Create startup script
+COPY startup.sh /startup.sh
+RUN chmod +x /startup.sh
+
+# Expose port
+EXPOSE 80
+
+# Start services
+CMD ["/startup.sh"]