Skip to content

Commit 96b8c72

Browse files
committed
refactor: streamline Dockerfile and add .dockerignore for dev files
1 parent d9e380b commit 96b8c72

3 files changed

Lines changed: 53 additions & 9 deletions

File tree

proxy/.dockerignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Credentials and auth files - must never be baked into image
2+
.powerwall
3+
.auth
4+
.pypowerwall.auth
5+
.pypowerwall.site
6+
.pypowerwall.fleetapi
7+
.fleetapi*
8+
.cachefile
9+
config.json
10+
fleet_tokens.json
11+
tedapi_rsa_*
12+
13+
# Certificates and keys
14+
*.pem
15+
*.der
16+
*.key
17+
18+
# Build/upload scripts and local-only files
19+
upload.sh
20+
upload-beta.sh
21+
.beta_version
22+
beta.txt
23+
perf_test.py
24+
localtest.sh
25+
testproxy.sh
26+
uploadtest.sh
27+
28+
# Docs
29+
API.md
30+
README.md
31+
HELP.md
32+
RELEASE.md
33+
34+
# Symlink / local dev copy (replaced by cp in upload-beta.sh, restored after)
35+
teslapy
36+
37+
# Dev noise
38+
.DS_Store
39+
__pycache__/
40+
*.pyc
41+
*.pyo
42+
tests/

proxy/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ WORKDIR /app
55
# Install system dependencies
66
RUN apk add --no-cache git curl
77

8-
# Install proxy extra dependencies first
9-
RUN pip3 install --no-cache-dir bs4
8+
# Install pypowerwall and proxy dependencies
9+
COPY requirements.txt /tmp/requirements.txt
10+
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt
1011

11-
# Copy full source and install pypowerwall from local source
12-
COPY . /build
13-
RUN pip3 install --no-cache-dir /build && rm -rf /build
14-
15-
# Copy proxy server files
16-
COPY proxy/ /app/
12+
# Copy proxy server files (only runtime-needed files)
13+
COPY server.py transform.py __init__.py /app/
14+
COPY web/ /app/web/
1715
EXPOSE 8675
1816
CMD ["python3", "server.py"]

proxy/Dockerfile.beta

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ RUN apk add --no-cache git curl
88
COPY beta.txt /app/requirements.txt
99
RUN pip3 install --no-cache-dir -r requirements.txt
1010

11-
COPY . .
11+
# Copy proxy server files (only runtime-needed files)
12+
COPY server.py transform.py __init__.py /app/
13+
COPY web/ /app/web/
14+
# Copy local pypowerwall source for beta testing (placed here by upload-beta.sh)
15+
COPY pypowerwall/ /app/pypowerwall/
1216
EXPOSE 8675
1317
CMD ["python3", "server.py"]

0 commit comments

Comments
 (0)