Go to file
2024-06-07 13:41:28 -04:00
beer Basic outline of yeast sample page. 2024-06-07 07:54:23 -04:00
config Fix renamed property. 2024-06-07 08:46:11 -04:00
equipment Modify admin page a bit. 2024-06-07 08:53:43 -04:00
templates Basic outline of yeast sample page. 2024-06-07 07:54:23 -04:00
yeast Didn't do migration first. 2024-06-07 13:35:10 -04:00
.gitignore Fix indents in makefile. 2024-06-03 13:06:21 -04:00
Makefile Pull from the current branch. 2024-06-06 11:48:02 -04:00
manage.py initial commit. 2024-05-30 16:26:55 -04:00
README.md initial commit. 2024-05-30 16:26:55 -04:00
requirements.txt Add gunicorn to requirements. 2024-06-03 12:55:35 -04:00
run.sh Activate virtual environment 2024-06-07 13:41:28 -04:00

Compose sample application

Django application in dev mode

Project structure:

.
├── compose.yaml
├── app
    ├── Dockerfile
    ├── requirements.txt
    └── manage.py

compose.yaml

services: 
  web: 
    build: app 
    ports: 
      - '8000:8000'

Deploy with docker compose

$ docker compose up -d
Creating network "django_default" with the default driver
Building web
Step 1/6 : FROM python:3.7-alpine
...
...
Status: Downloaded newer image for python:3.7-alpine
Creating django_web_1 ... done

Expected result

Listing containers must show one container running and the port mapping as below:

$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                    NAMES
3adaea94142d        django_web          "python3 manage.py r…"   About a minute ago   Up About a minute   0.0.0.0:8000->8000/tcp   django_web_1

After the application starts, navigate to http://localhost:8000 in your web browser:

Stop and remove the containers

$ docker compose down