Commit d304800e authored by Jon Yu's avatar Jon Yu
Browse files

Initial commit for PostgreSQL bits

parent bcf4925e
......@@ -3,13 +3,25 @@ version: '3'
services:
app:
build:
context: .
context: ./app
args:
ENVIRONMENT: DEVELOPMENT
env_file: .env
env_file: ./app/.env
ports:
- 127.0.0.1:8000:8000
volumes:
- .:/usr/src/app
entrypoint: ../docker-entrypoint.sh
- ./app:/usr/src/app
entrypoint: ./docker-entrypoint.sh
command: "python3 manage.py runserver 0.0.0.0:8000 --nostatic"
depends_on:
- db
db:
image: postgres:12-alpine
env_file:
- ./db/.env
ports:
- 5432:5432
volumes:
- postgres-data:/var/lib/pgsql/data
volumes:
postgres-data:
......@@ -14,6 +14,7 @@ if [ "$#" -ne 2 ]; then
echo "Usage: $1 Project Output Path; $2 Project Name" >&2
exit 1
fi
if ! [ -d "$1" ]; then
echo "$1 not a directory" >&2
exit 1
......@@ -21,6 +22,6 @@ fi
trap clean_up EXIT
docker build -t $IMAGE_TAG .
docker build -t $IMAGE_TAG ./app
docker run --rm -d -t -v "$1":"$CONTAINER_PROJECT_DIR":z --name $CONTAINER_NAME --entrypoint /bin/bash $IMAGE_TAG
docker exec -it $CONTAINER_NAME django-admin startproject --template ./ "$2" "$CONTAINER_PROJECT_DIR"
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment