From a4b15af866553819b4d57c3ce0031f7256236570 Mon Sep 17 00:00:00 2001 From: Raymond Bernardo Date: Mon, 31 May 2021 16:50:29 -0400 Subject: [PATCH 1/8] Add docker environment --- Dockerfile | 16 ++++++++++++++++ README.md | 12 +++++++++++- docker-compose.yml | 8 ++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b5954c1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM python:3 + +WORKDIR /plane + +COPY . . + +# Add pipenv +RUN pip install pipenv + +# Install dependencies +RUN pipenv install + +# Added needed folder for plane-notify process +RUN mkdir /var/run/plane-notify + +CMD pipenv run python __main__ diff --git a/README.md b/README.md index 7bfd82b..9249790 100644 --- a/README.md +++ b/README.md @@ -90,9 +90,19 @@ screen -R ### Start Program ```bash -pipenv run __main__ +pipenv run python __main__ ``` +## Using with Docker + +Install [docker from their website](https://docs.docker.com/get-docker/). Run the following command from the root of the project. + +``` +docker-compose up -d +``` + +After running this command, dut to the `-d` flag the container will be running in the background. To see the logs of the docker + ### TODO - General Cleanup diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2adc5d3 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: "3.9" +services: + plane-notify: + command: sh -c "sleep 500" + build: + context: . + volumes: + - ./:/plane From 62a30a0390a48bcb1589c286185914256aaeb034 Mon Sep 17 00:00:00 2001 From: Raymond Bernardo Date: Mon, 31 May 2021 18:10:06 -0400 Subject: [PATCH 2/8] Update dockerfile to install a specific version of pipenv Codeacy didn't like not specifying the version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b5954c1..641bec9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ WORKDIR /plane COPY . . # Add pipenv -RUN pip install pipenv +RUN pip install pipenv==2021.5.29 # Install dependencies RUN pipenv install From 740a6107a8d5777d8401f4327b5204c8def218a8 Mon Sep 17 00:00:00 2001 From: Raymond Bernardo Date: Mon, 31 May 2021 18:17:22 -0400 Subject: [PATCH 3/8] Fix bug in docker files --- Dockerfile | 4 ++-- docker-compose.yml | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 641bec9..d0bfa1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM python:3 -WORKDIR /plane +WORKDIR /plane-notify COPY . . @@ -13,4 +13,4 @@ RUN pipenv install # Added needed folder for plane-notify process RUN mkdir /var/run/plane-notify -CMD pipenv run python __main__ +CMD pipenv run python /plane-notify/__main__.py diff --git a/docker-compose.yml b/docker-compose.yml index 2adc5d3..aa50af9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,7 @@ version: "3.9" services: plane-notify: - command: sh -c "sleep 500" build: context: . volumes: - - ./:/plane + - ./:/plane-notify From c0af386df742fbf88171f44f251363dd58af607a Mon Sep 17 00:00:00 2001 From: Raymond Bernardo Date: Mon, 31 May 2021 18:20:40 -0400 Subject: [PATCH 4/8] Add language flag to new docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9249790..073e50d 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ pipenv run python __main__ Install [docker from their website](https://docs.docker.com/get-docker/). Run the following command from the root of the project. -``` +```bash docker-compose up -d ``` From b82a25f24811b60529701e13fc3d3047c0bcde82 Mon Sep 17 00:00:00 2001 From: Raymond Bernardo Date: Mon, 31 May 2021 22:57:52 -0400 Subject: [PATCH 5/8] Replace "discord-webhooks" with "discord-webhook" --- Pipfile | 2 +- Pipfile.lock | 58 +++++++++++++++++++++++++++------------------------- 2 files changed, 31 insertions(+), 29 deletions(-) diff --git a/Pipfile b/Pipfile index c588d3e..69b809e 100644 --- a/Pipfile +++ b/Pipfile @@ -13,10 +13,10 @@ pytz = "*" pillow = "*" tweepy = "*" "pushbullet.py" = "*" -discord-webhooks = "*" selenium = "*" opensky-api = {editable = true, git = "https://github.com/openskynetwork/opensky-api.git", subdirectory = "python"} webdriver-manager = "*" +discord-webhook = "*" [requires] python_version = "3.9" diff --git a/Pipfile.lock b/Pipfile.lock index a84a698..7c607b9 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "47aeaf96ca8a1d06f00eb9cac1333a4fcf34c676503e4c02df56c5135b3dba10" + "sha256": "d41ac7cee51c5e9792798cbe020d3a1231ee1e0af3555771bd296c9afbd77d72" }, "pipfile-spec": 6, "requires": { @@ -18,18 +18,18 @@ "default": { "certifi": { "hashes": [ - "sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c", - "sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830" + "sha256:2bbf76fd432960138b3ef6dda3dde0544f27cbf8546c458e60baf371917ba9ee", + "sha256:50b1e4f8446b06f41be7dd6338db18e0990601dce795c2b1686458aa7e8fa7d8" ], - "version": "==2020.12.5" + "version": "==2021.5.30" }, "chardet": { "hashes": [ - "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", - "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" + "sha256:0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa", + "sha256:f864054d66fd9118f2e67044ac8981a54775ec5b67aed0441892edb553d21da5" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", - "version": "==3.0.4" + "version": "==4.0.0" }, "colorama": { "hashes": [ @@ -54,12 +54,13 @@ ], "version": "==0.4.0" }, - "discord-webhooks": { + "discord-webhook": { "hashes": [ - "sha256:b8db5fbf80edd0324df095419eac62826b2f5b93680684d3e941f6376d9cf567" + "sha256:d7774538321e62967b4248accfcad56972f05b9e07bd6599cd0d1c2ba376b325", + "sha256:f946aa5cc820e3cb95575f43ff0ac1e37d655a25cb214ca1a3b74a6af71d7e13" ], "index": "pypi", - "version": "==1.0.4" + "version": "==0.13.0" }, "geographiclib": { "hashes": [ @@ -78,11 +79,11 @@ }, "idna": { "hashes": [ - "sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407", - "sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c" + "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6", + "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==2.8" + "version": "==2.10" }, "oauthlib": { "hashes": [ @@ -118,6 +119,7 @@ "sha256:63728564c1410d99e6d1ae8e3b810fe012bc440952168af0a2877e8ff5ab96b9", "sha256:66cc56579fd91f517290ab02c51e3a80f581aba45fd924fcdee01fa06e635812", "sha256:6c32cc3145928c4305d142ebec682419a6c0a8ce9e33db900027ddca1ec39178", + "sha256:8b56553c0345ad6dcb2e9b433ae47d67f95fc23fe28a0bde15a120f25257e291", "sha256:8bb1e155a74e1bfbacd84555ea62fa21c58e0b4e7e6b20e4447b8d07990ac78b", "sha256:95d5ef984eff897850f3a83883363da64aae1000e79cb3c321915468e8c6add5", "sha256:a013cbe25d20c2e0c4e85a9daf438f85121a4d0344ddc76e33fd7e3965d9af4b", @@ -174,11 +176,11 @@ "socks" ], "hashes": [ - "sha256:502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e", - "sha256:7bf2a778576d825600030a110f3c0e3e8edc51dfaafe1c146e39a2027784957b" + "sha256:27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804", + "sha256:c210084e36a42ae6b9219e00e48287def368a26d03a048ddad7bfee44f75871e" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==2.21.0" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==2.25.1" }, "requests-oauthlib": { "hashes": [ @@ -222,27 +224,27 @@ }, "urllib3": { "hashes": [ - "sha256:2393a695cd12afedd0dcb26fe5d50d0cf248e5a66f75dbd89a3d4eb333a61af4", - "sha256:a637e5fae88995b256e3409dc4d52c2e2e0ba32c42a6365fee8bbd2238de3cfb" + "sha256:753a0374df26658f99d826cfe40394a686d05985786d946fbe4165b5148f5a7c", + "sha256:a7acd0977125325f516bda9735fa7142b909a8d01e8b2e4c8108d0984e6e0098" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' and python_version < '4'", - "version": "==1.24.3" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", + "version": "==1.26.5" }, "webdriver-manager": { "hashes": [ - "sha256:00bb38c91a1aee23ef09699df074f7328a3618abbe5bf23944b7e835ad561dd6", - "sha256:254a3c58a253785433ce0d8afd1d6a46ebf0e62137bb05a963c033958610c6da" + "sha256:50a6e174106542f5335cacc387cec7ada26812babc1aeca61c208a1bab2ac2c5", + "sha256:c6d81590aae6fc0fb10cf7dd20c8c1b9bb043501f9cf62c316a854a0de841e32" ], "index": "pypi", - "version": "==3.4.1" + "version": "==3.4.2" }, "websocket-client": { "hashes": [ - "sha256:2e50d26ca593f70aba7b13a489435ef88b8fc3b5c5643c1ce8808ff9b40f0b32", - "sha256:d376bd60eace9d437ab6d7ee16f4ab4e821c9dae591e1b783c58ebd8aaf80c5c" + "sha256:3e2bf58191d4619b161389a95bdce84ce9e0b24eb8107e7e590db682c2d0ca81", + "sha256:abf306dc6351dcef07f4d40453037e51cc5d9da2ef60d0fc5d0fe3bcda255372" ], - "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==0.59.0" + "markers": "python_version >= '3.6'", + "version": "==1.0.1" } }, "develop": {} From 9e7ee99cf2e9489f7d78201819b6fe1c8e3930f5 Mon Sep 17 00:00:00 2001 From: Raymond Bernardo Date: Tue, 27 Jul 2021 21:40:28 -0400 Subject: [PATCH 6/8] Add google chrome to dockerfile --- Dockerfile | 9 ++++++++- docker-compose.yml | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d0bfa1b..ef295af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,13 @@ WORKDIR /plane-notify COPY . . +# Set the Chrome repo. +RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ + && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list + +# Install Chrome. +RUN apt-get update && apt-get -y install google-chrome-stable + # Add pipenv RUN pip install pipenv==2021.5.29 @@ -13,4 +20,4 @@ RUN pipenv install # Added needed folder for plane-notify process RUN mkdir /var/run/plane-notify -CMD pipenv run python /plane-notify/__main__.py +CMD pipenv run python /plane-notify/__main__.py \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index aa50af9..223040b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,7 @@ version: "3.9" services: plane-notify: + platform: linux/amd64 build: context: . volumes: From 3ab441f9dcdf530137ef66e646cf4129f65bac9b Mon Sep 17 00:00:00 2001 From: Raymond Bernardo Date: Tue, 27 Jul 2021 22:19:28 -0400 Subject: [PATCH 7/8] Update plane process folder --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ef295af..0e73f2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,6 @@ RUN pip install pipenv==2021.5.29 RUN pipenv install # Added needed folder for plane-notify process -RUN mkdir /var/run/plane-notify +RUN mkdir /home/plane-notify/ CMD pipenv run python /plane-notify/__main__.py \ No newline at end of file From 67b5e3d4d84c28bb0ff03ddb8333cf5e2890b1e7 Mon Sep 17 00:00:00 2001 From: Raymond Bernardo Date: Tue, 27 Jul 2021 22:20:18 -0400 Subject: [PATCH 8/8] Remove extra slash --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0e73f2e..bc1f050 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,6 @@ RUN pip install pipenv==2021.5.29 RUN pipenv install # Added needed folder for plane-notify process -RUN mkdir /home/plane-notify/ +RUN mkdir /home/plane-notify CMD pipenv run python /plane-notify/__main__.py \ No newline at end of file