-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (27 loc) · 918 Bytes
/
Dockerfile
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
FROM python:3.11-slim
# Setup env
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONFAULTHANDLER 1
# Install compilation dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Upgrade pip, setuptools, wheel, aiohttp and pipenv
RUN python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel aiohttp pipenv
# Create and switch to a new user
RUN useradd --create-home appuser
WORKDIR /home/appuser
USER appuser
# Get Rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/home/appuser/.local/bin:/home/appuser/.cargo/bin:${PATH}"
# Install application into container
COPY . .
# Install the requirements
RUN pipenv requirements > requirements.txt \
&& pip3 install --no-cache-dir -r requirements.txt
# Run the application
CMD ["python3", "sense-monitor-to-influxdb.py"]