Skip to content

Commit

Permalink
fix(requirements): Updated requirements; updated base image
Browse files Browse the repository at this point in the history
  • Loading branch information
b32147 committed Nov 7, 2024
1 parent 6507d93 commit 95d9388
Show file tree
Hide file tree
Showing 4 changed files with 306 additions and 201 deletions.
29 changes: 27 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM hmsdbmitc/dbmisvc:debian11-slim-python3.6-0.2.0 AS builder
FROM hmsdbmitc/dbmisvc:debian12-slim-python3.12-0.7.0 AS builder

# Install requirements
RUN apt-get update \
Expand All @@ -9,6 +9,7 @@ RUN apt-get update \
gcc \
default-libmysqlclient-dev \
libssl-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*

# Add requirements
Expand All @@ -19,7 +20,23 @@ RUN pip install -U wheel \
&& pip wheel -r /requirements.txt \
--wheel-dir=/root/wheels

FROM hmsdbmitc/dbmisvc:debian11-slim-python3.6-0.2.0
FROM hmsdbmitc/dbmisvc:debian12-slim-python3.12-0.7.0

ARG APP_NAME="dbmisvc-starter"
ARG APP_CODENAME="dbmisvc-starter"
ARG VERSION
ARG COMMIT
ARG DATE

LABEL org.label-schema.schema-version=1.0 \
org.label-schema.vendor="HMS-DBMI" \
org.label-schema.version=${VERSION} \
org.label-schema.name=${APP_NAME} \
org.label-schema.build-date=${DATE} \
org.label-schema.description="DBMISVC Starter" \
org.label-schema.url="https://github.com/hms-dbmi/dbmisvc-starter" \
org.label-schema.vcs-url="https://github.com/hms-dbmi/dbmisvc-starter" \
org.label-schema.vcf-ref=${COMMIT}

# Copy Python wheels from builder
COPY --from=builder /root/wheels /root/wheels
Expand All @@ -28,6 +45,7 @@ COPY --from=builder /root/wheels /root/wheels
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
default-libmysqlclient-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*

# Add requirements files
Expand All @@ -42,6 +60,9 @@ RUN pip install --no-index \
# and Pip errors out on the mismatches.
-r /requirements.in

# Setup entry scripts
ADD docker-entrypoint-init.d/* /docker-entrypoint-init.d/

# Copy app source
COPY /starter /app

Expand Down Expand Up @@ -70,3 +91,7 @@ ENV DBMI_LB=true
ENV DBMI_SSL=true
ENV DBMI_CREATE_SSL=true
ENV DBMI_HEALTHCHECK=true

# Django configurations
ENV DJANGO_CONFIGURATION=Production
ENV DJANGO_SETTINGS_MODULE=starter.settings
6 changes: 4 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ version: '2.3'

services:
db:
image: mysql:5.7
image: mysql:8.0-bookworm
ports:
- '3306'
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
Expand All @@ -22,6 +22,8 @@ services:
- .env
environment:
GUNICORN_CMD_ARGS: "--log-level info --reload --access-logfile /var/log/gunicorn.log"
DJANGO_CONFIGURATION: Development

volumes:
- ./starter:/app
- ./docker-entrypoint-init.d/45-django-admin.sh:/docker-entrypoint-init.d/45-django-admin.sh
Expand Down
5 changes: 3 additions & 2 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Django<4.0
django-dbmi-client<0.5.0
Django<6.0
django-configurations<3.0
django-dbmi-client<2.0
django-health-check<4.0
djangorestframework<4.0
mysqlclient<3.0
Loading

0 comments on commit 95d9388

Please # to comment.