-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (36 loc) · 1.13 KB
/
Copy pathDockerfile
File metadata and controls
47 lines (36 loc) · 1.13 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
# Use Python 3.11 as base image
FROM python:3.11-slim
# Add useful command line tools and gosu for step-down from root
RUN apt-get update && \
apt-get install -y curl wget git jq zip unzip rsync tree telnet netcat-traditional gosu file bind9-host bind9-dnsutils make&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy requirements file
COPY requirements.txt .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY main.py .
COPY app/ ./app/
COPY docker-entrypoint.sh /usr/local/bin/
COPY setup_ssh_keys.sh /usr/local/bin/
COPY setup_git_config.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh \
&& chmod +x /usr/local/bin/setup_ssh_keys.sh \
&& chmod +x /usr/local/bin/setup_git_config.sh
# Set environment variables
ENV HOST=0.0.0.0
ENV PORT=8000
ENV WORKDIR=/home/projects
# Default UID/GID (can be overridden at runtime)
ENV UID=1000
ENV GID=1000
# Create directory for projects
RUN mkdir -p /home/projects
# Expose port
EXPOSE 8000
# Set entrypoint
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["python", "main.py"]