-
Notifications
You must be signed in to change notification settings - Fork 582
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
43 additions
and
3 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,9 @@ | ||
FROM python:3 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY requirements.txt ./ | ||
|
||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
CMD [ "python", "./app.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Directoryfix for python | ||
|
||
if [ ! -d ./volumes/python/app ]; then | ||
sudo mkdir -p ./volumes/python/app | ||
sudo chown -R pi:pi ./volumes/python | ||
echo 'print("hello world")' >./volumes/python/app/app.py | ||
|
||
fi |
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,7 @@ | ||
python: | ||
container_name: python | ||
build: ./services/python/. | ||
restart: unless-stopped | ||
network_mode: host | ||
volumes: | ||
- ./volumes/python/app:/usr/src/app |
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 |
---|---|---|
@@ -1 +1,15 @@ | ||
#!/bin/bash | ||
|
||
echo "Stopping containers" | ||
docker-compose down | ||
|
||
echo "Downloading latest images from docker hub ... this can take a long time" | ||
docker-compose pull | ||
|
||
echo "Building images if needed" | ||
docker-compose build | ||
|
||
echo "Starting stack up again" | ||
docker-compose up -d | ||
|
||
echo "Consider running prune-images to free up space" |