This project sets up a development environment using Docker with the following services:
- PXL Devbox: A development container with essential tools and Python libraries pre-installed.
- InfluxDB: A time-series database for storing metrics and data.
- Chronograf: A web interface for InfluxDB, enabling data visualization and management.
- Image: Custom-built from
01_pxl_devbox. - Purpose: Development environment with Python, FastAPI, InfluxDB client, and other utilities.
- Ports: Exposes port
80for development. - Features:
- Base Image: Ubuntu 22.04.
- Pre-installed libraries:
- FastAPI
0.68.1 - Uvicorn
0.15.0 - Pandas
2.2.3 - PyMongo
4.2.0 - Bcrypt
4.0.0 - Passlib
1.7.4 - SlowAPI
0.1.6 - PyJWT
2.4.0
- FastAPI
- Development tools:
tmux,vim,nano,git,htop,python3-pip. - Includes SSH support and custom
tmuxconfigurations.
- Image: Custom-built from
02_influxdb. - Purpose: Time-series database for storing metrics.
- Ports: Exposes port
8086. - Features:
- Base Image:
influxdb:1.8-alpine. - Includes SSH support.
- User-configurable environment variables for database credentials.
- Persistent data storage via volumes.
- Base Image:
- Image:
chronograf:1.8-alpine(official image). - Purpose: Web-based interface for visualizing and managing InfluxDB data.
- Ports: Exposes port
8888. - Features:
- Pre-configured to connect to the InfluxDB service.
- Stores Chronograf settings and dashboards in persistent volumes.
| Volume Path | Service | Description |
|---|---|---|
./App |
PXL Devbox | Application code for the development environment. |
./Data |
PXL Devbox, Chronograf | Data storage shared between services. |
./Commands |
PXL Devbox | Custom scripts and commands for the devbox. |
./Logs |
PXL Devbox | Logs generated by the devbox. |
./Test |
PXL Devbox | Test files for the devbox. |
./InfluxDB |
InfluxDB | Persistent data directory for InfluxDB. |
./Data/chronograf |
Chronograf | Persistent data directory for Chronograf. |
All services are connected via the pxl_influx_network Docker network. This ensures inter-service communication while isolating them from external traffic.
| Service | Image/Version | Notes |
|---|---|---|
| PXL Devbox | Custom-built from Ubuntu 22.04 | Includes Python 3.10, FastAPI 0.68.1, Pandas 2.2.3, and other tools. |
| InfluxDB | influxdb:1.8-alpine |
Lightweight version of InfluxDB 1.8. |
| Chronograf | chronograf:1.8-alpine |
Official Chronograf 1.8 version. |
- Build the images
./000_build_images.sh
- Restart the docker environment (only the DevBox and InfluxDB)
./001_create_and_restart_containers.sh
Wait for the images to be downloaded and the containers to be set up.
- Setup InfluxDB with username
adminand password:password, and initialize the tokens for telegraf
./002_init_influx_and_telegraf.sh
- DevBox: Attach a bash shell to the DevBox container by executing the following script:
./003_attach_bash_to_devbox_container.sh
Testing InfluxDB connection from the DevBox:
cd test
python3 test_influx_conn.py
You can start a jupyter environment by executing:
start_jupyter
(preferable in the home directory)
- InfluxDB: Attach a bash shell to the InfluxDB container by executing the following script:
./004_attach_bash_to_influxdb_container.sh