AseedUsmani / test-113-q-565f22747a2a425f8e7fe713dd1c09a4--flask-1.0.4-p-3.7-in-docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cj-app

Flask 1.1.1 - Python 2.7

IMPORTANT NOTES:

1. If the backend require any database please use any IN-MEMORY or SQLLite database Unless mentioned in Questions Otherwise .
3. Make sure you follow the steps mentioned under "PROJECT START STEPS" and ensure that the steps execute successfully. 
4. Make sure you follow the steps mentioned under "DOCKER START STEPS" and ensure that the steps execute successfully. 

PROJECT START STEPS:

Pre-requisites:
1. Install need python and pip to be installed in your system.


Steps:
1. To run this application, do the following:
    1.a. Go to the project root directory.
    1.b. Run the following commands to install dependencies of the app:
    	- pip install -r requirements.txt
    1.c. Run the following command(s) in the terminal/command line to run the app:    
        - python restapi.py

2. Go to http://localhost:8080 in your browser to view it.

DOCKER START STEPS:

Pre-requisites:
1. Make sure Docker is installed. Follow the Steps from http://console.codejudge.io/setup 

Steps:
1. Build the docker image:
    1.a. Go to the project root directory.
    1.b. Run the following command(s) in the terminal/command line:
        - docker build -t cj-app .

2. Run the image in a container (Make sure port 4200 is available):        
    2.a. Run the following command(s) in the terminal/command line:
        - docker run -i -p8080:p8080 cj-app
    2.b. Check the logs for any errors. 

3. Go to http://localhost:8080 in your browser to view it.

DOCKER STOP STEPS:

Steps:
1. Run the following commands:
    - docker ps
2. Copy the container id and run the below command:
    - docker stop <container_id> 
    - docker system prune

DOCKER LOGS:

Steps:
1. Run the following commans(s):
    - docker ps
2. Copy the container id and run the below command:
    - docker logs <container_id>

DOCKER REMOVE CONTAINER:

Steps:
1. Run the following command(s):
    - docker ps
2. Copy the container id and run the below command:
    - docker rm <container_id>
    - docker system prune

DOCKER REMOVE IMAGE:

Steps:
1. Run the following command(s):
    - docker ps
2. Copy the image id and run the below command:
    - docker rmi <image_id>
    - docker system prune

About


Languages

Language:Python 94.6%Language:Dockerfile 5.4%