File tree Expand file tree Collapse file tree 3 files changed +76
-0
lines changed Expand file tree Collapse file tree 3 files changed +76
-0
lines changed Original file line number Diff line number Diff line change 1+ # Use the official Python image as the base image
2+ FROM python:3.9-slim
3+
4+ # Set a working directory inside the container
5+ WORKDIR /app
6+
7+ # Copy project files into the container
8+ COPY . /app
9+
10+ # Ensure pip is updated
11+ RUN pip install --upgrade pip
12+
13+ # Install required Python packages
14+ COPY requirements.txt ./
15+ RUN pip install -r requirements.txt
16+
17+ # Command to run your application
18+ CMD ["python" , "main.py" ]
Original file line number Diff line number Diff line change @@ -182,6 +182,56 @@ These can also be set via arguments in the CLI:
182182python3 main.py --mode daily --log-level INFO --show-detailed-logs
183183```
184184
185+ ## 🐳 Docker
186+
187+ You can run Squidleet using Docker. Below are the steps to set up and run the application using Docker.
188+
189+ ### Build Docker Image
190+
191+ Clone the repository and navigate to the project directory:
192+ ``` bash
193+ git clone https://github.com/daily-coding-problem/squidleet.git
194+ cd squidleet
195+ ```
196+
197+ Build the Docker image:
198+ ``` bash
199+ docker build -t squidleet .
200+ ```
201+
202+ ### Run the Docker Container
203+
204+ Run the Docker container and mount the directory where your environment file (` .env ` ) is located:
205+ ``` bash
206+ docker run --rm -it --env-file .env squidleet
207+ ```
208+
209+ To specify additional options (e.g., modes), append them to the run command:
210+ ``` bash
211+ docker run --rm -it --env-file .env squidleet --mode daily
212+ ```
213+
214+ ### Using Docker Compose
215+
216+ If you prefer using Docker Compose, you can create a ` docker-compose.yml ` file with the following content:
217+
218+ ``` yaml
219+ version : " 3.8"
220+ services :
221+ squidleet :
222+ build : .
223+ environment :
224+ - LEETCODE_SESSION=<your_session_cookie>
225+ stdin_open : true
226+ tty : true
227+ command : ["--mode", "daily"]
228+ ` ` `
229+
230+ To run the container:
231+ ` ` ` bash
232+ docker-compose up
233+ ```
234+
185235## License
186236
187237Squidleet is open-sourced under the MIT License. See the ` LICENSE ` file for more details.
Original file line number Diff line number Diff line change 1+ services :
2+ squidleet :
3+ build :
4+ context : .
5+ container_name : squidleet
6+ image : squidleet:latest
7+ env_file :
8+ - .env
You can’t perform that action at this time.
0 commit comments