-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.docker
67 lines (52 loc) · 2.03 KB
/
Makefile.docker
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
58
59
60
61
62
63
64
65
66
67
#
# If you want to kill docker.
# - ps auxw | grep runserver
# - kill -9 xxx the server
#
# postgres
# https://stackoverflow.com/questions/60420940/how-to-fix-error-error-database-is-uninitialized-and-superuser-password-is-not
APP_NAME=crawler-buddy
build:
# poetry lock -> to write lock file
docker build -t $(USER_NAME)/$(APP_NAME) .
build-clean:
# poetry lock -> to write lock file
docker build --no-cache -t $(USER_NAME)/$(APP_NAME) .
run:
# docker run -p 3000:3000 $(USER_NAME)/$(APP_NAME)
docker compose up
list:
docker ps -a
# docker images
stop:
docker stop container_id
remove:
# if poetry complains do poetry update
docker container rm container_id
install:
sudo apt install docker.io -y
sudo systemctl start docker
sudo usermod -aG docker $USER
#
# installation as in https://www.linuxtechi.com/how-to-install-docker-on-linux-mint/#6_Test_Docker_Installation
#
#sudo apt install -y apt-transport-https ca-certificates curl gnupg
#curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/dockerce.gpg
#echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/dockerce.gpg] https://download.docker.com/linux/ubuntu jammy stable" | sudo tee /etc/apt/sources.list.d/dockerce.list > /dev/null
#sudo apt update
#sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
#sudo usermod -aG docker $USER
#newgrp docker
#
echo Installation successful, please reboot computer
install-portainer:
docker pull portainer/portainer-ce:latest
docker run -d -p 9000:9000 --restart always -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer-ce:latest
push:
# docker login --username $(USER_NAME) --password $(USER_PASSWORD)
# docker image tag local-image:INIT new-repo:tagname
docker push $(USER_NAME)/$(APP_NAME)
refresh:
docker exec -d container_id poetry run celery call app.tasks.process_all_jobs -a '["rsshistory.threadhandlers.OneTaskProcessor"]'
compose-refresh:
docker compose up --build $(USER_NAME)/$(APP_NAME)