I have created a Dockerfile and docker-compose.yml file. I can run docker-compose up on Windows 10 which builds and then runs my Django web application. I can then successfully browse to 127.0.0.1:7000 and exercise my web application.
My question is, once I exit, how do fire up my image w/o running docker-compose up again?
When I type docker images I see two images: python and my_web_app. I've tried
docker run --publish 7000:8000 -- detach my_web_app
but it exits immediately.
My Dockerfile
FROM python:3.6
ENV PYTHONUNBUFFERED 1
COPY ./requirements.txt /requirements.txt
RUN pip install -r /requirements.txt
RUN mkdir /code
WORKDIR /code
ADD . /code/
RUN useradd user
USER user
My docker-compose.yml
version: "3"
services:
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "7000:8000"