-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (42 loc) · 1.29 KB
/
Dockerfile
File metadata and controls
56 lines (42 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# SSH Parameter Manager Dockerfile
FROM python:3.9-slim
# Set metadata
LABEL maintainer="SSH Parameter Manager Team"
LABEL description="A professional tool for managing Symfony parameters.yml files via SSH"
LABEL version="2.1.0"
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV FLASK_APP=web_server.py
ENV FLASK_ENV=production
# Create app directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
openssh-client \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY *.py ./
COPY *.html ./
COPY ssh_config.example.yml ./
# Create directories for data
RUN mkdir -p /app/logs /app/backups /app/downloaded_configs
# Create non-root user
RUN useradd --create-home --shell /bin/bash app && \
chown -R app:app /app
# Switch to non-root user
USER app
# Create SSH directory for the app user
RUN mkdir -p /home/app/.ssh && \
chmod 700 /home/app/.ssh
# Expose port
EXPOSE 5000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:5000/api/status || exit 1
# Default command
CMD ["python", "web_server.py"]