Skip to content

Commit

Permalink
docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
diepirio committed Jun 16, 2023
1 parent 74ddd92 commit b22a0a5
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
__pycache__
docker-compose.yaml
Makefile
.gitignore
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# MAKEFILE SETTINGS
# Silence default command echoing
.SILENT:
# Use one shell for all commands in a target recipe
.ONESHELL:
.EXPORT_ALL_VARIABLES:
# Set phony targets
.PHONY: help build up down
# Set default goal
.DEFAULT_GOAL := help
# Use bash shell in Makefile instead of sh
SHELL = /bin/bash

build: ## Build docker image
docker compose build

up: build ## Run docker compose service
docker compose up -d
sleep 3
echo "open http://127.0.0.1:8888/lab"
bash -c "open http://127.0.0.1:8888/lab"
sleep 2
docker logs -n 1000 -f glances-jupyterlab

down: ## Stop docker compose service
docker compose down

rebuild: down up ## Rebuild docker compose service

# Display target comments in 'make help'
help: ## Show this help
grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
36 changes: 36 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: "3.9"

services:
jupyterlab:
image: jupyter/glances:test
build:
context: "."
dockerfile: setup/Dockerfile
container_name: glances-jupyterlab
restart: always
ports:
- 8888:8888
environment:
PGHOST: postgres
PGPORT: 5432
PGDATABASE: postgres
PGUSER: postgres
PGPASSWORD: postgres
volumes:
- "${PWD}:/home/jovyan/jupyter-glances-proxy"
postgres:
image: postgres:15.3-alpine
hostname: postgres
container_name: glances
restart: always
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- db:/var/lib/postgresql/data

volumes:
db:
name: db

0 comments on commit b22a0a5

Please sign in to comment.