automated push from the terminal

This commit is contained in:
Software Shinobi
2026-02-09 11:38:30 -05:00
parent 5539582a92
commit 189c6b7b26
3 changed files with 21 additions and 87 deletions

View File

@@ -1,47 +1,20 @@
# base image
FROM python:3.8
# setup environment variable
ENV DockerHOME=/home/app/webapp
# set work directory
RUN mkdir -p $DockerHOME
# where your code lives
WORKDIR $DockerHOME
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# install dependencies
RUN mkdir -p $DockerHOME
WORKDIR $DockerHOME
RUN pip install --upgrade pip
# copy whole project to your docker home directory.
#RUN pip install --upgrade pip
RUN pip install "pip<24.1"
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
# run this command to install all dependencies
RUN pip install -r requirements.txt
RUN python3 manage.py makemigrations
RUN python3 manage.py migrate
# port where the Django app runs
EXPOSE 8000
# start server
CMD python manage.py runserver 0.0.0.0:8000
# Use a shell script or combined command for runtime tasks
CMD python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000

View File

@@ -1,52 +1,13 @@
#!/bin/bash
##
set -e
set -x
set -x
##
reset
clear
##
# 1. Shut down existing containers
docker compose down --remove-orphans
docker compose up -d
# 2. Build and start containers in the background
# The Dockerfile's CMD will handle migrations and runserver automatically.
docker compose up -d --build
sleep 8
########
###docker-compose -f postgres.yaml pull
#python3 manage.py dumpdata
## This will IRREVERSIBLY DESTROY all data currently in the "maverickdb" database, and return each table to an empty state.
### python3 manage.py flush
### python3 manage.py sqlflush
#python3 manage.py sqlmigrate
##python3 manage.py sqlsequencereset
#python3 manage.py generateschema
python3 manage.py makemigrations
python3 manage.py migrate
#python3 manage.py squashmigrations bikes
#python3 manage.py optimizemigration
python3 manage.py runserver 0.0.0.0:8888
# 3. (Optional) Check the logs to ensure the migrations finished successfully
docker compose logs -f

View File

@@ -1,5 +1,3 @@
version: "3"
services:
card-players-unite-postgres:
@@ -28,6 +26,8 @@ services:
card-players-unite-pgadmin:
build: .
container_name: card-players-unite-pgadmin
image: dpage/pgadmin4