feature/ssh-server (#1)
All checks were successful
/ ssh-client (push) Successful in 10s
/ ssh-server (push) Successful in 10s

Co-authored-by: Márcio Fernandes <marcio.fernandes@outlook.pt>
Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
2025-09-07 13:50:18 +00:00
parent ea24e0e41a
commit ce1d7a749a
23 changed files with 727 additions and 10 deletions

View File

@@ -0,0 +1,48 @@
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ 🐳 Dockerfile: Multi-Stage Build for Python + SSH App ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
# ──────────────── Stage 1: Base ────────────────
# Base image using Debian Bullseye
FROM debian:bullseye AS base
# Suppress interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Install core dependencies:
# - Python 3 and pip
# - OpenSSH server for remote access
# - sudo for privilege escalation
RUN apt-get update && \
apt-get install -y \
python3 \
python3-pip \
openssh-server \
curl && \
mkdir /var/run/sshd && \
apt-get clean
# Create config directory for app (can be used by dev/prod stages)
RUN mkdir -p /etc/app/config
# ──────────────── Stage 2: Prod ────────────────
# Production stage inherits from base
FROM base AS prod
# Copy full app code into image (self-contained)
COPY app/ /app
# Set working directory
WORKDIR /app
RUN pip install --no-cache-dir -r requirements.txt
ENV CONFIGURATION=Production
ENV DEBUG=False
# Default command for production container
CMD ["python3", "-u", "/app/main.py"]
#EXPOSE 22