Skip to content

Commit

Permalink
Merge pull request #178 from stephengtuggy/alpine-base-img
Browse files Browse the repository at this point in the history
Change base Docker image to Alpine
  • Loading branch information
stephengtuggy authored Jul 20, 2024
2 parents 8abf4ea + 39f615b commit a777358
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
5 changes: 1 addition & 4 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
FROM python:3.12.4-slim-bookworm
FROM python:3.12.4-alpine3.20

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

WORKDIR /usr/src/app

RUN apt-get -y update
RUN apt-get -y upgrade

RUN python -m pip install --upgrade --upgrade-strategy eager pip

RUN mkdir -p /usr/src/app
Expand Down
2 changes: 1 addition & 1 deletion app/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh

# Abort the entire script if an error occurs
set -e
Expand Down
4 changes: 2 additions & 2 deletions app/pg_dump.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash
#!/bin/sh

PGPASSWORD="$JOB_HISTORY_DB_PASSWORD" pg_dump --file=backup_to_restore.sql --format=p --clean --encoding=utf8 --if-exists --dbname=$JOB_HISTORY_DB_NAME --host=$JOB_HISTORY_DB_HOST --port=$JOB_HISTORY_DB_PORT --username=$JOB_HISTORY_DB_USERNAME
PGPASSWORD="$JOB_HISTORY_DB_PASSWORD" pg_dump --file=backup_to_restore.sql --format=p --clean --encoding=utf8 --if-exists --dbname="$JOB_HISTORY_DB_NAME" --host="$JOB_HISTORY_DB_HOST" --port=$JOB_HISTORY_DB_PORT --username="$JOB_HISTORY_DB_USERNAME"
4 changes: 2 additions & 2 deletions app/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
asgiref==3.8.1
astroid==3.2.3
astroid==3.2.4
colorama==0.4.6
dill==0.3.8
Django==4.2.14
Expand All @@ -11,7 +11,7 @@ platformdirs==4.2.2
pylint==3.2.5
pytz==2024.1
six==1.16.0
sqlparse==0.5.0
sqlparse==0.5.1
tomlkit==0.13.0
wheel==0.43.0
whitenoise==6.7.0
Expand Down
15 changes: 8 additions & 7 deletions app/tcp-port-wait.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#!/usr/bin/env bash
set -e
#!/bin/sh

if [ -z "$1" -o -z "$2" ]
set -e

if [ -z "$1" ] || [ -z "$2" ]
then
echo "tcp-port-wait - block until specified TCP port becomes available"
echo "Usage: ntcp-port-wait HOST PORT"
echo "Usage: tcp-port-wait HOST PORT"
exit 1
fi
echo Waiting for port $1:$2 to become available...
while ! nc -z $1 $2 2>/dev/null
echo Waiting for port "$1":$2 to become available...
while ! nc -z "$1" $2 2>/dev/null
do
let elapsed=elapsed+1
elapsed=$elapsed+1
if [ "$elapsed" -gt 90 ]
then
echo "TIMED OUT !"
Expand Down

0 comments on commit a777358

Please sign in to comment.