-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (20 loc) · 814 Bytes
/
Copy pathDockerfile
File metadata and controls
28 lines (20 loc) · 814 Bytes
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
# Use a slim Python 3.11 base image for a lightweight container
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install system dependencies, including Redis
RUN apt-get update && apt-get install -y \
redis-server \
&& rm -rf /var/lib/apt/lists/*
# Define environment variable for Redis password
ENV REDIS_PASSWORD=CHANGEME
# Create Redis configuration file with the password from environment variable
RUN echo "requirepass $REDIS_PASSWORD" > /etc/redis/redis.conf
# Copy project files
COPY . .
# Install Python dependencies
RUN pip install --no-cache-dir bottle redis requests
# Expose port 8000 for the Bottle application
EXPOSE 8000
# Start Redis with the custom configuration and run the Bottle application
CMD redis-server /etc/redis/redis.conf --daemonize yes && python server.py