chore: move to using Make
- Updated README.md
This commit is contained in:
parent
2737e06262
commit
4c1dc9428c
@ -54,6 +54,6 @@ windows:
|
|||||||
layout: main-vertical
|
layout: main-vertical
|
||||||
root: ~/Desktop/University/Fall2023_Classes/COEN366/project
|
root: ~/Desktop/University/Fall2023_Classes/COEN366/project
|
||||||
panes:
|
panes:
|
||||||
- docker-compose up --build --remove-orphans
|
- make build
|
||||||
- sleep 15 && docker exec -it project-ftp_client-1 python client.py --debug 1
|
- sleep 15 && make client
|
||||||
- sleep 15 && docker exec -it project-ftp_server-1 python server.py --port_number 12000 --debug 1
|
- sleep 15 && make server
|
||||||
|
14
Makefile
Normal file
14
Makefile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
.PHONY: build client server clean
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker-compose up --build --remove-orphans
|
||||||
|
|
||||||
|
server:
|
||||||
|
docker exec -it project-ftp_server-1 python server.py --port_number 12000 --debug 1 --directory /server_directory
|
||||||
|
|
||||||
|
client:
|
||||||
|
docker exec -it project-ftp_client-1 python client.py --directory /client_directory --debug 1
|
||||||
|
|
||||||
|
clean:
|
||||||
|
docker-compose down --volumes
|
||||||
|
|
12
README.md
12
README.md
@ -20,16 +20,18 @@ You can run `python3 src/myftp/server.py --directory <insert valid directory tha
|
|||||||
|
|
||||||
### Dependencies
|
### Dependencies
|
||||||
|
|
||||||
`docker` and `docker-compose`
|
- `docker`
|
||||||
|
- `docker-compose`
|
||||||
|
- `make`
|
||||||
|
|
||||||
### Setup
|
### Setup
|
||||||
|
|
||||||
- Make you are at the root of this repo.
|
- Make you are at the root of this repo.
|
||||||
- Build the system with `docker-compose up --build --remove-orphans`.
|
- Build the system with `make build`.
|
||||||
- Wait 10 seconds.
|
- Wait 10 seconds.
|
||||||
- 2 containers will be created on the same network `mynetwork`. Their respective IP addresses will be printed to stdout.
|
- 2 containers will be created on the same network `mynetwork`. Their respective IP addresses will be printed to stdout.
|
||||||
- Open two terminal windows: one for each of server and client.
|
- Open two terminal windows: one for each of server and client.
|
||||||
- Run the server with `docker exec -it project-ftp_server_1 python server.py --directory /server_directory <insert any other flags here>`.
|
- Run the server with `make server` in a terminal.
|
||||||
- Run the client with `docker exec -it project-ftp_client_1 python client.py --directory /client_directory <insert any flags here>`.
|
- Run the client with `make client` in a terminal.
|
||||||
- For the client, when asked to put in the ip address and port number of the server, you can put in `ftp_server 12000` or adjust to your chosen port number. The IP address is resolved by Docker so ftp_server can not be changed.
|
- For the client, when asked to put in the ip address and port number of the server, you can put in `ftp_server 12000` or adjust to your chosen port number. The IP address is resolved by Docker so ftp_server can not be changed.
|
||||||
- Tear down everything with `docker-compose down`.
|
- Tear down everything with `make clean`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user