forked from yandex-praktikum/taski-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1cedc32
commit 398458c
Showing
6 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
venv | ||
.git | ||
db.sqlite3 | ||
idea | ||
.vscode | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Создать образ на основе базового слоя, | ||
# который содержит файлы ОС и интерпретатор Python 3.9. | ||
FROM python:3.9-slim | ||
|
||
# Переходим в образе в директорию /app: в ней будем хранить код проекта. | ||
# Если директории с указанным именем нет, она будет создана. | ||
# Название директории может быть любым. | ||
WORKDIR /app | ||
# Дальнейшие инструкции будут выполняться в директории /app | ||
|
||
# Скопировать с локального компьютера файл зависимостей | ||
# в текущую директорию (текущая директория — это /app). | ||
COPY requirements.txt . | ||
|
||
# Выполнить в текущей директории команду терминала | ||
# для установки зависимостей. | ||
RUN pip install -r requirements.txt --no-cache-dir | ||
|
||
# Скопировать всё необходимое содержимое | ||
# той директории локального компьютера, где сохранён Dockerfile, | ||
# в текущую рабочую директорию образа — /app. | ||
COPY . . | ||
|
||
# При старте контейнера запустить сервер разработки. | ||
CMD ["python", "manage.py", "runserver", "0:8000"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
Django==3.2.3 | ||
djangorestframework==3.12.4 | ||
django-cors-headers==3.13.0 | ||
django-cors-headers==3.13.0 | ||
django-environ==0.10.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM node:18-slim | ||
WORKDIR /app | ||
|
||
COPY package.json package.json | ||
COPY package-lock.json package-lock.json | ||
|
||
RUN npm install | ||
|
||
COPY . . | ||
RUN npm run build | ||
|
||
# Эта команда запустит встроенный сервер на Node.js, который будет раздавать | ||
# содержимое директории /app/build на порте 8000 | ||
CMD ["npx", "-y", "http-server", "-p", "8000", "/app/build"] |