From 5254c53bd968c55d0250561794ce7c395dde337f Mon Sep 17 00:00:00 2001 From: a <@> Date: Fri, 19 Dec 2025 20:25:04 -0500 Subject: [PATCH] update to actually build stuff --- Dockerfile | 30 ++++++++++++------------------ README.md | 13 ++----------- 2 files changed, 14 insertions(+), 29 deletions(-) diff --git a/Dockerfile b/Dockerfile index 17ace52..c8bd65e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,17 @@ -FROM ubuntu:22.04 -LABEL maintainer "pystyle" +FROM ubuntu:22.04 AS builder -ENV LC_ALL C.UTF-8 -ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get install -y \ + build-essential cmake git libboost-all-dev -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - build-essential \ - ca-certificates \ - cmake \ - git \ - libboost-all-dev +WORKDIR /app +COPY . . -# Install SSH server -RUN apt-get install -y --no-install-recommends openssh-server && \ - echo "root:root" | chpasswd && \ - sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/" /etc/ssh/sshd_config +RUN mkdir build && cd build && \ + cmake .. && make && make install -RUN rm -rf /var/lib/apt/lists/* +FROM ubuntu:22.04 +WORKDIR /app +COPY --from=builder /app/build/install ./install -EXPOSE 22 -CMD service ssh start && /bin/bash +EXPOSE 50000 +CMD ["./install/bin/nanikiru"] diff --git a/README.md b/README.md index fd6140a..b8fd9b3 100644 --- a/README.md +++ b/README.md @@ -87,19 +87,10 @@ Build and run container. ```bash docker build . --tag mahjong-cpp -docker run -itP --name mahjong-cpp mahjong-cpp +docker run -p 8002:50000 -d --name mahjong-cpp mahjong-cpp ``` -Build program on the created container. - -```bash -git clone https://github.com/nekobean/mahjong-cpp.git -cd mahjong-cpp -mkdir build && cd build -cmake .. -make -j$(nproc) -make install -``` +Container accessible through http://127.0.0.1:8002 ## Usage