added Dockerfile + compose setup
This commit is contained in:
parent
67084bbaed
commit
e802ed4fe3
4 changed files with 32 additions and 1 deletions
5
.dockerignore
Normal file
5
.dockerignore
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
__pycache__/
|
||||
index.db*
|
||||
tinyweb_identity
|
||||
.git/
|
||||
*.md
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,4 +1,3 @@
|
|||
__pycache__/
|
||||
tinyweb_identity
|
||||
index.db
|
||||
index.db
|
||||
|
|
|
|||
16
Dockerfile
Normal file
16
Dockerfile
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
FROM python:3.12-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN mkdir -p /data \
|
||||
&& ln -sf /data/index.db index.db \
|
||||
&& ln -sf /data/tinyweb_identity tinyweb_identity
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["python", "app.py"]
|
||||
11
docker-compose.yml
Normal file
11
docker-compose.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
services:
|
||||
tinyweb:
|
||||
build: .
|
||||
ports:
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- tinyweb-data:/data
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
tinyweb-data:
|
||||
Loading…
Add table
Add a link
Reference in a new issue