Skip to content

Commit

Permalink
Merge pull request #235 from AIndoria/main
Browse files Browse the repository at this point in the history
Fix failing touch command, Fix named Volume in compose file, Fix needless downloading of docker-compose
  • Loading branch information
WongSaang authored Jul 16, 2023
2 parents 54330e0 + 59376ee commit c5ecba3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions deployment.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,18 @@ else
fi
if [[ $(which docker-compose) ]]; then
echo "Docker Compose is already installed"
echo "Docker Compose is already installed as 'docker-compose'"
DOCKER_COMPOSE_CMD="docker-compose"
elif [[ $(which docker) && $(docker compose version) ]]; then
echo "Docker Compose is available as 'docker compose'"
DOCKER_COMPOSE_CMD="docker compose"
else
echo "Docker Compose is not installed, installing now..."

sudo curl -L "https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose
DOCKER_COMPOSE_CMD="docker-compose"
fi

echo "Downloading configuration files..."
Expand All @@ -75,8 +81,8 @@ fi

echo "Starting services..."

touch ./db_sqlite3/db.sqlite3
touch ./db.sqlite3

sudo APP_DOMAIN="${APP_DOMAIN}:${SERVER_PORT}" CLIENT_PORT=${CLIENT_PORT} SERVER_PORT=${SERVER_PORT} WSGI_PORT=${WSGI_PORT} DB_URL=${DATABASE_URL} docker-compose up -d
sudo APP_DOMAIN="${APP_DOMAIN}:${SERVER_PORT}" CLIENT_PORT=${CLIENT_PORT} SERVER_PORT=${SERVER_PORT} WSGI_PORT=${WSGI_PORT} DB_URL=${DATABASE_URL} $DOCKER_COMPOSE_CMD up -d

echo "Done"
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ services:
# - EMAIL_USE_TLS=True
# - EMAIL_FROM=no-reply@example.com #Default sender email address
volumes:
- db_sqlite3:/app/db.sqlite3
- ./db_sqlite3:/app/db.sqlite3
ports:
- '${WSGI_PORT:-8000}:8000'
networks:
Expand Down

0 comments on commit c5ecba3

Please sign in to comment.