Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a3847e0

Browse files
author
yashksaini-coder
committed
Dockerfile completed --> 8th run
1 parent 2da5a65 commit a3847e0

File tree

3 files changed

+108
-0
lines changed

3 files changed

+108
-0
lines changed

‎.dockerignore

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# .dockerignore - Ignore files for Docker build
2+
3+
# Git
4+
.git
5+
.gitignore
6+
7+
# Python
8+
__pycache__/
9+
*.py[cod]
10+
*$py.class
11+
*.so
12+
.Python
13+
env/
14+
venv/
15+
ENV/
16+
build/
17+
develop-eggs/
18+
dist/
19+
downloads/
20+
eggs/
21+
.eggs/
22+
lib/
23+
lib64/
24+
parts/
25+
sdist/
26+
var/
27+
wheels/
28+
*.egg-info/
29+
.installed.cfg
30+
*.egg
31+
32+
# Docker
33+
.dockerignore
34+
Dockerfile
35+
docker-compose.yml
36+
37+
# Development environments
38+
.idea/
39+
.vscode/
40+
*.swp
41+
*.swo
42+
43+
# Logs
44+
logs/
45+
*.log
46+
47+
# OS generated files
48+
.DS_Store
49+
.DS_Store?
50+
._*
51+
.Spotlight-V100
52+
.Trashes
53+
ehthumbs.db
54+
Thumbs.db
55+
56+
node_modules/

‎Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM python:3.9-slim
2+
3+
WORKDIR /app
4+
5+
# Install dependencies including curl for healthcheck
6+
RUN apt-get update && apt-get install -y curl && \
7+
apt-get clean && rm -rf /var/lib/apt/lists/*
8+
9+
# Install Python dependencies
10+
COPY requirements.txt .
11+
RUN pip install --no-cache-dir -r requirements.txt
12+
13+
# Set file permissions and line endings
14+
COPY . .
15+
RUN find /app -type f -name "*.py" -exec chmod +x {} \; && \
16+
find /app -type f -name "*.sh" -exec chmod +x {} \;
17+
18+
# Create config file
19+
RUN echo "[HOST]\nhost = 0.0.0.0\nport = 5000\n\n[DEBUG]\ndebug = true" > config.ini
20+
21+
# Expose port
22+
EXPOSE 5000
23+
24+
# Set environment variables
25+
ENV FLASK_APP=app.py
26+
ENV PYTHONUNBUFFERED=1
27+
ENV PYTHONDONTWRITEBYTECODE=1
28+
29+
# Run the integrated application with Windows-compatible syntax
30+
CMD ["python", "-u", "app.py"]

‎docker-compose.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: '3'
2+
3+
services:
4+
blockchain-app:
5+
build: .
6+
container_name: blockchain-app
7+
ports:
8+
- "5000:5000"
9+
volumes:
10+
- ./:/app:delegated
11+
environment:
12+
- FLASK_APP=app.py
13+
- FLASK_ENV=development
14+
- PYTHONUNBUFFERED=1
15+
- PYTHONDONTWRITEBYTECODE=1
16+
healthcheck:
17+
test: ["CMD", "curl", "--fail", "http://localhost:5000"]
18+
interval: 30s
19+
timeout: 10s
20+
retries: 3
21+
start_period: 5s
22+
restart: unless-stopped

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /