Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add configuration files for Docker to be able to build an image.
- Loading branch information
Showing
11 changed files
with
87 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
app/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
__pycache__/ | ||
venv/ | ||
|
||
app/config.py | ||
app/data/config.py | ||
log.txt | ||
messages.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM python:3.7 | ||
|
||
WORKDIR /home/textUtilsBot | ||
|
||
COPY requirements.txt . | ||
RUN pip install -r requirements.txt | ||
|
||
USER www-data | ||
COPY app ./app | ||
|
||
EXPOSE 8443/tcp | ||
|
||
CMD ["python", "app/bot.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: "3" | ||
services: | ||
textUtilsBot: | ||
build: . | ||
image: kozalo/textutilsbot | ||
container_name: textutilsbot | ||
hostname: testUtilsBot | ||
working_dir: /home/textUtilsBot | ||
restart: always | ||
ports: | ||
- "8080:8443" # host:container | ||
volumes: | ||
- "./app/data:/home/textUtilsBot/app/data" | ||
- "/tmp:/tmp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
if [ ! -f "app/data/config.py" ]; then | ||
echo "A configuration file was not found. Copying the skeleton..." | ||
|
||
cp examples/config.py app/data/config.py | ||
sudo chgrp www-data app/data/config.py | ||
chmod o-r app/data/config.py | ||
|
||
echo "Edit the 'app/data/config.py' file and run this script again." | ||
exit | ||
fi | ||
|
||
cmp --silent "examples/config.py" "app/data/config.py" | ||
if [ $? -eq 0 ]; then | ||
echo "Don't forget to change the values in the 'app/data/config.py' file!" | ||
exit | ||
fi | ||
|
||
if [ $(stat -c "%U" app/data) != "www-data" ]; then | ||
echo "The 'app/data' directory must be owned by the 'www-data' user! Trying to fix it..." | ||
sudo chown www-data app/data | ||
fi | ||
|
||
docker-compose up -d |