Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hyuksun98/khu-mcl-docker
khu-mcl seminar : docker
https://github.com/hyuksun98/khu-mcl-docker
containerd docker docker-compose
Last synced: 3 days ago
JSON representation
khu-mcl seminar : docker
- Host: GitHub
- URL: https://github.com/hyuksun98/khu-mcl-docker
- Owner: hyuksun98
- Created: 2024-07-29T06:16:42.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-30T06:32:30.000Z (4 months ago)
- Last Synced: 2024-07-31T07:03:30.360Z (4 months ago)
- Topics: containerd, docker, docker-compose
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## khu-mcl-docker
### 0. FYI
Because this repository was designed for a lab seminar,
code efficiency aspects were not considered.So, please keep in mind that this is simply a repository
for learning 'Docker'.### 1. app.py
This script runs a simple web server using 'Flask' and
demonstrates a client sending a message to the server.The server runs in a new thread, while the client
sends a message to the server after a certain delay
and prints the server's response.### 2.Dockerfile
Environment variables are used to set the server's port and the client's message
at the time running 'Docker Container'.USER_NAME variable will be set while building docker-image.
### 3. How to use
1) Clone the repository
2) Move to ```khu-mcl-docker```
```shell
cd khu-mcl-docker
```3) Build Docker Image
```shell
docker build --build-arg USER_NAME=$USER -t flask_app:latest .
```4) Run the Container
```shell
docker run -p 3000:5000 -e FLASK_PORT=5000 -e CLIENT_MESSAGE="Hello from $USER!" --name flask_server flask_app:latest
```5) Enter into the Container
```shell
docker exec -it flask_server /bin/bash# Exit Container
exit
```