Simple django proj. dockerized
- Python 3.7+
- Django 4.2.1+
- PostgreSQL
- Clone the project repository
git clone https://github.com/Anatolii-Poznyak/new_test_task.git
cd new_test_task
- Create a virtual environment
python3 -m venv venv
source venv/bin/activate
- Create .env file based on .env.sample file and set variables.
cp .env.sample .env
- If you want to use Docker, set
POSTGRES_HOST=db
- Also set your superuser credentials in
.env
- DOCKER should be installed
docker-compose up
- The server will run on 127.0.0.1:8000
- superuser and fake_data will be created and loaded automatically via custom migrations
- To enter the container =>
docker compose exec app sh
ordocker exec -it <your container name> /bin/bash
- Containers list =>
docker ps
- Fake data is generated by
fake_data.py
command
-
Click
#!/bin/bash yum update -y yum install -y docker service docker start usermod -a -G docker ec2-user curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose docker-compose version yum install -y git git clone https://github.com/Anatolii-Poznyak/new_test_task.git /home/ec2-user/new_test_task cd /home/ec2-user/new_test_task echo "DJANGO_SECRET_KEY=test" >> .env echo "DJANGO_DEBUG=True" >> .env echo "POSTGRES_HOST=db" >> .env # And all others environment variables... docker-compose up -d