Skip to content
Merged
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
67 changes: 67 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/conf/bbsd.conf
/conf/bbsnet.conf
/conf/badwords.conf
/conf/ssh_host_rsa_key*
/conf/ssh_host_ed25519_key*
/conf/ssh_host_ecdsa_key*
/utils/conf/db_conn.conf.php
/aclocal.m4
/autom4te.cache
/COPYING
/compile
/conf/*.user
/conf/ca_cert.pem
/conf/lbbs.logrotate
/conf/lbbs.logrotate~
/conf/lbbs.service
/conf/lbbs.service~
/config.guess
/config.h
/config.h.in
/config.h.in~
/config.log
/config.status
/config.sub
/configure
/configure~
/data/*.user
/depcomp
/INSTALL
/install-sh
/libtool
/log
/ltmain.sh
/m4
/missing
/NEWS
/var
CVS
.cvsignore
Makefile
Makefile.in
stamp-h1
lt-*.c
*_ltshwrapper
*.o
*.Po
*.Plo
*.a
*.la
*.lai
*.so
*.so.*
*.lo
*.Tpo
*.exe
/src/bbsd
/src/test_trie_dict
/src/test_file_loader
/src/test_section_list
/src/test_lml
/src/test_ssh_server
/src/test_article_favor
/src/test_article_view_log
/src/test_memory_pool
/src/test_bbs
/src/test_bwf
/src/test_hash_dict
19 changes: 19 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Build the Docker image
run: docker build . --file Dockerfile/dockerfile.bbsd --tag lbbs-bbsd:$(date +%s)
54 changes: 54 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Publish Docker image

on:
release:
types: [published]

env:
BBSD_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-bbsd

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v5

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: leafok/lbbs

- name: Build and push Docker image
id: push-bbsd
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile/dockerfile.bbsd
push: true
tags: |
${{ env.BBSD_IMAGE }}:${{ github.ref_name }}
${{ env.BBSD_IMAGE }}:latest
labels: ${{ steps.meta.outputs.labels }}
5 changes: 1 addition & 4 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ jobs:
sudo apt-get update
sudo apt-get install -y libssh-dev libsystemd-dev

- name: Display GCC version
run: gcc -v

- name: configure
run: ./configure --enable-systemd --disable-silent-rules
run: ./configure

- name: Run make
run: make
Expand Down
33 changes: 33 additions & 0 deletions Dockerfile/dockerfile.bbsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM debian:latest

ARG LBBS_HOME_DIR=/usr/local/lbbs

# Install locales package and generate en_US.UTF-8
RUN apt-get update && apt-get install -y locales && \
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen

# Set environment variables for the locale
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

RUN apt-get update && apt-get install -y \
gcc make gdb autoconf automake libtool pkg-config \
libssh-dev libpcre2-dev libmariadb-dev libsystemd-dev \
php-cli php-mysql

# Copy the custom configuration file
COPY ./Dockerfile/php.ini /usr/local/etc/php/php.ini

RUN mkdir -p ${LBBS_HOME_DIR}

COPY ./ /home/lbbs_src
WORKDIR /home/lbbs_src

RUN autoreconf --install --force
RUN ./configure --prefix=${LBBS_HOME_DIR} && \
make && \
make install

WORKDIR ${LBBS_HOME_DIR}
Loading