https://github.com/shearichard/dofl
A dockered flask for use in K8S tests
https://github.com/shearichard/dofl
docker flask flyio python
Last synced: 3 months ago
JSON representation
A dockered flask for use in K8S tests
- Host: GitHub
- URL: https://github.com/shearichard/dofl
- Owner: shearichard
- License: gpl-3.0
- Created: 2020-05-28T02:21:49.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-01T23:17:04.000Z (about 3 years ago)
- Last Synced: 2025-10-30T19:08:05.685Z (8 months ago)
- Topics: docker, flask, flyio, python
- Language: Python
- Homepage:
- Size: 52.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DOFL
A simple [Flask](https://palletsprojects.com/p/flask/) app to be put into a [Docker](https://www.docker.com/) container for use as a testbed while doing some [Kubernetes](https://kubernetes.io/) work.
## Dockerfile
The initial version of the Docker file is based on [this blog post](https://hasura.io/blog/how-to-write-dockerfiles-for-python-web-apps-6d173842ae1d/).
## Development Virtenv
The name of the development vm is dofl37.
Activate like this ...
```
. ./dofl37/bin/activate
```
Using the [virtualenv.pyz](https://virtualenv.pypa.io/en/stable/installation.html#via-zipapp) instead of installing virtualenv properly due to weirdness arising from the way I have 3.7 installed on the development vm.
The target python is 3.7 which is installed at /usr/local/bin/python3.7 on the development vm.
## Docker Cheat Sheet
```
$ docker build -t dkr-flsk .;docker image ls;
...
$ docker container ls --all
...
$ docker rm abdd314c875c
...
$ docker container ls --all
...
$ docker run -p 8080:8080 -d dkr-flsk
...
$ docker container ls --all
```
## Docker perms
When working on a new development machine for the first time remember to [add the current user to the 'docker' group](https://techoverflow.net/2017/03/01/solving-docker-permission-denied-while-trying-to-connect-to-the-docker-daemon-socket/).
```
sudo usermod -a -G docker $USER
```
And exit your ssh session and reconnect before attempting a `docker build`.