mirror of
https://github.com/TheCommsChannel/TC2-BBS-mesh.git
synced 2025-03-05 20:51:53 -08:00
Revert Dockerfile changes
This commit is contained in:
parent
6a8811dca9
commit
2525d76100
|
@ -1,45 +1,36 @@
|
||||||
# First stage: Base build environment
|
# From original Dockerfile at https://github.com/TheCommsChannel/TC2-BBS-mesh
|
||||||
FROM debian:stable-slim AS build
|
FROM debian:stable-slim AS build
|
||||||
|
|
||||||
# Install required dependencies
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y git && \
|
apt-get install -y \
|
||||||
apt-get clean && rm -rf /var/lib/apt/lists/*
|
git \
|
||||||
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Ensure the 'games' directory exists
|
# Clone the repository
|
||||||
RUN mkdir -p /home/mesh/bbs/games
|
RUN git clone https://github.com/TheCommsChannel/TC2-BBS-mesh.git
|
||||||
|
|
||||||
# Set working directory
|
####
|
||||||
WORKDIR /home/mesh/bbs
|
|
||||||
|
|
||||||
# Copy project files including 'games' directory
|
FROM --platform=$BUILDPLATFORM python:alpine
|
||||||
COPY . /home/mesh/bbs/
|
|
||||||
|
|
||||||
# Second stage: Final runtime environment
|
# Switch to non-root user
|
||||||
FROM python:alpine
|
|
||||||
|
|
||||||
# Add a non-root user for security
|
|
||||||
RUN adduser --disabled-password mesh
|
RUN adduser --disabled-password mesh
|
||||||
|
USER mesh
|
||||||
# Ensure working directory
|
|
||||||
RUN mkdir -p /home/mesh/bbs
|
RUN mkdir -p /home/mesh/bbs
|
||||||
WORKDIR /home/mesh/bbs
|
WORKDIR /home/mesh/bbs
|
||||||
|
|
||||||
# Copy files from the build stage
|
|
||||||
COPY --from=build /home/mesh/bbs /home/mesh/bbs/
|
|
||||||
|
|
||||||
# Install Python dependencies
|
# Install Python dependencies
|
||||||
|
COPY --from=build /TC2-BBS-mesh/requirements.txt ./
|
||||||
RUN pip install --no-cache-dir --break-system-packages -r requirements.txt
|
RUN pip install --no-cache-dir --break-system-packages -r requirements.txt
|
||||||
|
|
||||||
# Ensure the 'games' directory exists in runtime container
|
# Copy over app code
|
||||||
RUN mkdir -p /home/mesh/bbs/games
|
COPY --from=build /TC2-BBS-mesh/*.py ./
|
||||||
|
|
||||||
# Set user to mesh
|
# Define config volume
|
||||||
USER mesh
|
VOLUME /home/mesh/bbs/config
|
||||||
|
WORKDIR /home/mesh/bbs/config
|
||||||
# Expose necessary ports
|
COPY --from=build /TC2-BBS-mesh/example_config.ini ./config.ini
|
||||||
EXPOSE 8080
|
COPY --from=build /TC2-BBS-mesh/fortunes.txt ./
|
||||||
|
|
||||||
# Start the server
|
|
||||||
CMD ["python", "server.py"]
|
|
||||||
|
|
||||||
|
# Define the command to run
|
||||||
|
ENTRYPOINT [ "python3", "/home/mesh/bbs/server.py" ]
|
||||||
|
|
Loading…
Reference in a new issue