An open API service indexing awesome lists of open source software.

https://github.com/studyresearchprojects/try-docker-python-server

🐳 A pretty simple try on Docker with a server written in Python
https://github.com/studyresearchprojects/try-docker-python-server

client docker python server test

Last synced: 8 months ago
JSON representation

🐳 A pretty simple try on Docker with a server written in Python

Awesome Lists containing this project

README

          

# try-docker-python-server
🐳 A pretty simple try on Docker with a server written in Python

# Motivation
Learn more about Docker.
Based on: [Gael Thomas, How to create a client/server side with Docker-Compose](https://medium.freecodecamp.org/a-beginners-guide-to-docker-how-to-create-a-client-server-side-with-docker-compose-12c8cf0ae0aa)

# Running the Docker Containers
In order to accomplish the steps ahead successfully, you must install Docker first.
[Docker Official Website](https://www.docker.com/get-started)

```bash
# from repository root directory
docker-compose build
```

This command will setup the containers.

Then feel free to run the docker-compose as follows:
```bash
docker-compose up
```

Now open your browser and go to the following URL:
http://localhost:8080/

You must see an HTML website served by Python's simple HTTP Client.

### Commands for Docker Compose

Command | Description
------------ | -------------
`docker-compose exec ` | Executes a command in the specified container
`docker-compose ps` | Lists containers
`docker-compose logs` | Logs from services
`docker-compose images` | Lists images
`docker-compose down` | Stops containers and removes images created in this instance of `docker-compose`
`docker-compose down -v --rmi all --remove-orphans` | Removes all data generated by the specified instance of `docker-compose`