-
Notifications
You must be signed in to change notification settings - Fork 304
Develop #286
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?
Develop #286
Changes from 3 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,17 @@ | ||
| ARG PYTHON_VERSION=3.8-slim | ||
| FROM python:${PYTHON_VERSION} AS builder | ||
| WORKDIR /app | ||
| COPY requirements.txt ./ | ||
| RUN pip install --target=/packages -r requirements.txt | ||
| COPY . ./ | ||
| ENV PYTHONPATH=/packages | ||
|
Comment on lines
+4
to
+7
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 command order is still incorrect. |
||
| RUN python manage.py migrate | ||
|
AlTym marked this conversation as resolved.
|
||
| # Run stage | ||
| ARG PYTHON_VERSION=3.8-slim | ||
| FROM python:${PYTHON_VERSION} | ||
|
AlTym marked this conversation as resolved.
|
||
| WORKDIR /app | ||
| ENV PYTHONUNBUFFERED=1 | ||
| ENV PYTHONPATH=/packages | ||
| COPY --from=builder /packages /packages | ||
| COPY --from=builder /app /app | ||
| CMD ["python", "manage.py", "runserver", "0.0.0.0:8080"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| Link to Docker repo: https://hub.docker.com/repository/docker/alyonatym/todoapp/general | ||
|
|
||
| instructions for building and running: | ||
| docker tag todoapp:1.0.0 alyonatym/todoapp:1.0.0 | ||
| docker push alyonatym/todoapp:1.0.0 | ||
| docker build -t todoapp:1.0.0 . | ||
|
Comment on lines
+4
to
+6
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 command sequence is incorrect. |
||
| docker run -p 8080:8080 todoapp | ||
|
|
||
| instructions on accessing the application via a browser: | ||
| go to http://localhost: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 commands are in the wrong order. You must build the image before you can tag it. Move
docker build -t todoapp:1.0.0 .to come before thedocker tagcommand.