-
Notifications
You must be signed in to change notification settings - Fork 305
add Dockerfile #287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
add Dockerfile #287
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # ToDo App Docker | ||
| ## Docker Hub | ||
| https://hub.docker.com/r/oleksijlyashenko1/todo-app | ||
| ## Build | ||
| docker build -t todo-app . | ||
| ## Run | ||
| docker run -p 8080:8080 todo-app | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The task requirement specifies the tag should be |
||
| ## Access | ||
| http://localhost:8080 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| ARG PYTHON_VERSION=3.10 | ||
| FROM python:${PYTHON_VERSION}-slim AS builder | ||
| WORKDIR /app | ||
| COPY requirements.txt . | ||
| RUN pip install --no-cache-dir --prefix=/install -r requirements.txt | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The build command uses |
||
|
|
||
| FROM python:${PYTHON_VERSION}-slim | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The run command references |
||
| WORKDIR /app | ||
| COPY --from=builder /install /usr/local | ||
| COPY . /app | ||
|
|
||
| RUN python manage.py migrate | ||
| ENV PYTHONUNBUFFERED=1 | ||
| CMD ["python", "manage.py", "runserver", "0.0.0.0:8080"] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The task requirement specifies naming the image
todoapp, but the instruction showsdocker build -t todo-app .. These should match the requirement.