Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing touch command, Fix named Volume in compose file, Fix needless downloading of docker-compose #235

Merged
merged 3 commits into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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