Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docker/docker-bind/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ bash ./tester.sh
---

### Ответ

sudo docker run -d --name jusan-docker-bind -p 7777:80 -v /home/sbeissov/nginx.conf:/etc/nginx/nginx.conf nginx:mainline

sudo docker ps

sudo docker logs jusan-docker-bind
6 changes: 6 additions & 0 deletions docker/docker-bind/solution.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
sudo docker run -d --name jusan-docker-bind -p 7777:80 -v /home/sbeissov/nginx.conf:/etc/nginx/nginx.conf nginx:mainline

sudo docker ps

sudo docker logs jusan-docker-bind
Empty file modified docker/docker-bind/tester-docker-bind.sh
100644 → 100755
Empty file.
8 changes: 8 additions & 0 deletions docker/docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
api:
image: jusan-dockerize:latest
build: ../dockerize
container_name: jusan-compose
ports:
- 8080:8080
restart: on-failure
26 changes: 26 additions & 0 deletions docker/docker-exec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,29 @@ bash ./tester.sh
---

### Ответ

1904 sudo docker run -d --name jusan-docker-exec -p 8181:80 nginx:mainline
1905 sudo docker exec -it jusan-docker-exec bash
1906 curl http://localhost:8181
1907 curl http://localhost:8181/home
1908 curl http://localhost:8181/about
1909 sudo docker logs jusan-docker-exec

1 cd /etc/nginx/conf.d/
2 ls
3 nano jusan-docker-exec.conf
4 cat << EOF > /etc/nginx/conf.d/jusan-docker-exec.conf
server {
listen 80;
server_name jusan.singularity;

location / {return 200 'Hello, from jusan-docker-exec';}
location /home {return 201 'This is my home!';}
location /about {return 202 'I am just an exercise!';}
}
EOF

5 cat jusan-docker-exec.conf
6 rm default.conf
7 nginx -s reload

24 changes: 24 additions & 0 deletions docker/docker-exec/solution.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
sudo docker run -d --name jusan-docker-exec -p 8181:80 nginx:mainline
sudo docker exec -it jusan-docker-exec bash
curl http://localhost:8181
curl http://localhost:8181/home
curl http://localhost:8181/about
sudo docker logs jusan-docker-exec

cd /etc/nginx/conf.d/
nano jusan-docker-exec.conf
cat << EOF > /etc/nginx/conf.d/jusan-docker-exec.conf
server {
listen 80;
server_name jusan.singularity;

location / {return 200 'Hello, from jusan-docker-exec';}
location /home {return 201 'This is my home!';}
location /about {return 202 'I am just an exercise!';}
}
EOF

cat jusan-docker-exec.conf
rm default.conf
nginx -s reload
2 changes: 2 additions & 0 deletions docker/docker-mount/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ bash ./tester.sh
---

### Ответ

sudo docker run -d --name jusan-docker-mount -p 9988:80 -v /home/sbeissov/github/TechOrda/docker/docker-mount/jusan-docker-mount.conf:/etc/nginx/conf.d/nginx.conf -v /home/sbeissov/github/TechOrda/docker/docker-mount/jusan-docker-mount:/usr/share/nginx/html nginx:mainline
8 changes: 8 additions & 0 deletions docker/docker-mount/jusan-docker-mount.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
server {
listen 80;
server_name example.com;

location / {
root /var/www/example;
}
}
Binary file added docker/docker-mount/jusan-docker-mount.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Hello, from jusan-docker-mount</h1>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Singularity
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Jusan
2 changes: 2 additions & 0 deletions docker/docker-mount/solution.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
sudo docker run -d --name jusan-docker-mount -p 9988:80 -v /home/sbeissov/github/TechOrda/docker/docker-mount/jusan-docker-mount.conf:/etc/nginx/conf.d/nginx.conf -v /home/sbeissov/github/TechOrda/docker/docker-mount/jusan-docker-mount:/usr/share/nginx/html nginx:mainline
11 changes: 11 additions & 0 deletions docker/docker-run/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,15 @@ bash ./tester.sh
---

### Ответ
sudo docker run -d --name jsn-dkr-run -p 8887:80 nginx:mainline
8e2cfdffa414de0acda7dc746ca3a0c1656c7d130269853e932a324f8a4348e9

sudo docker ps
8e2cfdffa414 nginx:mainline "/docker-entrypoint.…" 6 minutes ago Up 6 minutes 0.0.0.0:8887->80/tcp, [::]:8887->80/tcp

sudo docker stop jsn-dkr-run

sudo docker ps -a



6 changes: 6 additions & 0 deletions docker/docker-run/solution.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
sudo docker run -d --name jsn-dkr-run -p 8888:80 nginx:mainline
sudo docker ps
docker stop jsn-dkr-run
sudo docker ps
sudo docker ps -a
5 changes: 5 additions & 0 deletions docker/dockerfile/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM nginx:mainline
WORKDIR /var/www/jusan-dockerfile
COPY index.html .
COPY jusan-dockerfile.conf /etc/nginx/conf.d/default.conf

1 change: 1 addition & 0 deletions docker/dockerfile/jusan-dockerfile/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Hello, from jusan-dockerfile!</h1>
13 changes: 13 additions & 0 deletions docker/dockerfile/jusan-dockerfile/jusan-dockerfile.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
server {
listen 80;
server_name jusan.dockerfile;

location / {
root /var/www/jusan-dockerfile;
}

location /secret { return 201 'jusan-dockerfile';
}
location /jusan { return 201 'singularity' ;
}
}
6 changes: 6 additions & 0 deletions docker/dockerfile/solution.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
curl -O https://stepik.org/media/attachments/lesson/686238/jusan-dockerfile.conf
curl -O https://stepik.org/media/attachments/lesson/686238/jusan-dockerfile.zip
unzip jusan-dockerfile.zip
sudo docker build -t nginx:jusan-dockerfile .
sudo docker run -d -p 6060:80 --name jusan-dockerfile nginx:jusan-dockerfile
162 changes: 162 additions & 0 deletions docker/dockerize/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
6 changes: 6 additions & 0 deletions docker/dockerize/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM python:3.8
WORKDIR /app
COPY main.py /app/
RUN pip3 install fastapi uvicorn
EXPOSE 8080
CMD [ "uvicorn", "main:app", "--host", "0.0.0.0","--port", "8080" ]
Loading