daqc commited on
Commit
7758a4b
·
1 Parent(s): 933fe66

Add Docker config

Browse files
Files changed (3) hide show
  1. .dockerignore +57 -0
  2. Dockerfile +44 -0
  3. docker-compose.yml +25 -0
.dockerignore ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Version control
2
+ .git
3
+ .gitignore
4
+
5
+ # Python
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+ *.so
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+
28
+ # Virtual environments
29
+ .env*
30
+ !.env.example
31
+ .venv
32
+ env/
33
+ venv/
34
+ ENV/
35
+
36
+ # IDE
37
+ .idea/
38
+ .vscode/
39
+ *.swp
40
+ *.swo
41
+
42
+ # Testing
43
+ .tox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+
53
+ # Project specific
54
+ nltk_data/
55
+ .pdm-python
56
+ .pdm.toml
57
+ __pypackages__/
Dockerfile ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Python slim image as base
2
+ FROM python:3.10-slim AS builder
3
+
4
+ # Set environment variables
5
+ ENV PYTHONUNBUFFERED=1 \
6
+ PYTHONDONTWRITEBYTECODE=1 \
7
+ PIP_NO_CACHE_DIR=1
8
+
9
+ # Create and set working directory
10
+ WORKDIR /app
11
+
12
+ # Install system dependencies
13
+ RUN apt-get update && apt-get install -y --no-install-recommends \
14
+ build-essential \
15
+ curl \
16
+ git \
17
+ cmake \
18
+ && rm -rf /var/lib/apt/lists/*
19
+
20
+ # Copy project files
21
+ COPY . .
22
+
23
+ # Install project in editable mode
24
+ RUN pip install -e .
25
+
26
+ # Create non-root user
27
+ RUN useradd -m -u 1000 appuser && \
28
+ chown -R appuser:appuser /app
29
+
30
+ # Switch to non-root user
31
+ USER appuser
32
+
33
+ # Expose Gradio port
34
+ EXPOSE 7860
35
+
36
+ # Set default environment variables for configuration
37
+ ENV MODEL="meta-llama/Llama-3.1-8B-Instruct" \
38
+ MAGPIE_PRE_QUERY_TEMPLATE="llama3" \
39
+ MAX_NUM_TOKENS=2048 \
40
+ MAX_NUM_ROWS=1000 \
41
+ DEFAULT_BATCH_SIZE=5
42
+
43
+ # Start command
44
+ CMD ["python", "-m", "synthetic_dataset_generator"]
docker-compose.yml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: '3.8'
2
+
3
+ services:
4
+ app:
5
+ build: .
6
+ ports:
7
+ - "7860:7860"
8
+ env_file:
9
+ - .env
10
+ #volumes:
11
+ # - nltk_data:/app/nltk_data
12
+ healthcheck:
13
+ test: ["CMD", "curl", "-f", "http://localhost:7860/"]
14
+ interval: 30s
15
+ timeout: 10s
16
+ retries: 3
17
+ start_period: 40s
18
+ restart: unless-stopped
19
+
20
+ volumes:
21
+ nltk_data:
22
+
23
+ networks:
24
+ app-network:
25
+ driver: bridge