-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.combined
More file actions
43 lines (32 loc) · 1.23 KB
/
Dockerfile.combined
File metadata and controls
43 lines (32 loc) · 1.23 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
# Use the official Python image from the Docker Hub
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /app
# Add wait-for-it script
ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh /usr/local/bin/wait-for-it
RUN chmod +x /usr/local/bin/wait-for-it
# Copy requirements and install Python dependencies
COPY requirements-combined.txt .
RUN pip install --no-cache-dir -r requirements-combined.txt
# Create the secrets directory
RUN mkdir -p /app/.secrets
# First copy the secrets file directly - using explicit path
COPY ["./src/.secrets/secrets.toml", "/app/.secrets/"]
# Then copy the rest of the application
COPY ["./src/", "/app/"]
# Copy the entrypoint script and fix line endings
COPY docker-init-startup.sh /docker-init-startup.sh
RUN sed -i 's/\r$//' /docker-init-startup.sh && \
chmod +x /docker-init-startup.sh
# Set correct permissions
RUN chmod 644 /app/.secrets/secrets.toml && \
chmod -R 755 /app && \
echo "File permissions set"
# Expose the port that the web app will run on
EXPOSE 8088
# Set environment variables
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1
# Use the shell script as entrypoint
ENTRYPOINT ["/bin/sh", "/docker-init-startup.sh"]
CMD ["python", "main.py"]