Spaces:
Sleeping
Sleeping
add dockfile
Browse files- .gitignore +0 -0
- DOCKER +0 -0
- Dockerfile +39 -0
- README.md +9 -1
- requirements.txt +0 -0
.gitignore
ADDED
File without changes
|
DOCKER
ADDED
File without changes
|
Dockerfile
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use official Python runtime as base image
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Set working directory
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Install system dependencies
|
8 |
+
RUN apt-get update && apt-get install -y \
|
9 |
+
sqlite3 \
|
10 |
+
&& rm -rf /var/lib/apt/lists/*
|
11 |
+
|
12 |
+
# Copy requirements first to leverage Docker cache
|
13 |
+
COPY requirements.txt .
|
14 |
+
|
15 |
+
# Install Python dependencies
|
16 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
+
|
18 |
+
# Copy the rest of the application
|
19 |
+
COPY . .
|
20 |
+
|
21 |
+
# Create directory for static files
|
22 |
+
RUN mkdir -p /app/static
|
23 |
+
|
24 |
+
# Copy static files (HTML, JS, CSS)
|
25 |
+
COPY static/ /app/static/
|
26 |
+
COPY *.html /app/static/
|
27 |
+
|
28 |
+
# Create SQLite database directory
|
29 |
+
RUN mkdir -p /app/data
|
30 |
+
|
31 |
+
# Set environment variables
|
32 |
+
ENV PYTHONUNBUFFERED=1
|
33 |
+
ENV PORT=8000
|
34 |
+
|
35 |
+
# Expose the port the app runs on
|
36 |
+
EXPOSE 8000
|
37 |
+
|
38 |
+
# Command to run the application
|
39 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
README.md
CHANGED
@@ -1 +1,9 @@
|
|
1 |
-
# team9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# team9
|
2 |
+
|
3 |
+
### Docker
|
4 |
+
|
5 |
+
# Build the image
|
6 |
+
docker build -t p5js-game .
|
7 |
+
|
8 |
+
# Run the container
|
9 |
+
docker run -p 8000:8000 p5js-game
|
requirements.txt
ADDED
File without changes
|