forked from GivEnergy/giv_tcp
-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (43 loc) · 1.37 KB
/
Dockerfile
File metadata and controls
57 lines (43 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# givtcp-vuejs builder
FROM node:current-alpine AS givtcp_vuejs_tmp
# set the working directory in the container
WORKDIR /app
# Copy file dependencies in a single layer
COPY givtcp-vuejs .
RUN npm install && \
npm run build && \
mv dist/index.html dist/config.html
# set base image (host OS)
#FROM python:3.11-rc-alpine
FROM python:alpine3.19
RUN apk add --no-cache \
git \
mosquitto \
musl \
nginx \
redis \
tzdata \
xsel
RUN mkdir -p /run/nginx
# set the working directory in the container
WORKDIR /app
# copy the dependencies file to the working directory
COPY requirements.txt .
RUN pip install -r requirements.txt --no-cache-dir
COPY ingress.conf /etc/nginx/http.d/
COPY ingress_no_ssl.conf /app/ingress_no_ssl.conf
RUN rm /etc/nginx/http.d/default.conf
# copy the content of the local src directory to the working directory
COPY GivTCP/ ./GivTCP
COPY WebDashboard ./WebDashboard
# COPY givenergy_modbus/ /usr/local/lib/python3.11/site-packages/givenergy_modbus
COPY GivTCP/givenergy_modbus_async/ /usr/local/lib/python3.12/site-packages/givenergy_modbus_async
COPY api.json ./GivTCP/api.json
COPY startup.py startup.py
COPY redis.conf redis.conf
COPY settings.json ./settings.json
COPY ingress/ ./ingress
# Copy static site files
COPY --from=givtcp_vuejs_tmp /app/dist /app/ingress/
EXPOSE 1883 3000 6379 8099
CMD ["python3", "/app/startup.py"]