Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

fix: add docker_entrypoint.sh #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
39 changes: 23 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
FROM mysql:8.0-debian@sha256:1579fe3a97a436cc10824fc771a07fcedc92213e7ab7604eb5d2976ca419abc8
FROM mysql:8

ENV MYSQL_USER=ulabelbase
ENV MYSQL_DATABASE=labelbase
ENV MYSQL_ROOT_PASSWORD=labelbase
ENV MYSQL_PASSWORD=labelbase
ENV MYSQL_PWD=labelbase

RUN apt-get update && \
apt-get install -y \
default-libmysqlclient-dev \
build-essential pkg-config gcc \
cron vim logrotate \
libpcre3-dev \
python3-dev python3-pip \
#default-mysql-client \
nginx \
&& rm -rf /var/lib/apt/lists/*

# Cleanup to reduce image size
RUN apt-get purge -y --auto-remove build-essential
RUN \
# Explicitly disable PHP to suppress conflicting requests error
microdnf -y module disable php \
&& \
microdnf -y module enable nginx:1.22 && \
# Install stuff
microdnf -y install \
gcc \
mysql-devel \
pkg-config \
nginx \
python3.11 python3.11-pip python3.11-setuptools python3.11-wheel \
&& \
rm -rf /var/cache/dnf \
&& \
# forward request and error logs to container engine log collector
ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log

# Copy configs/migrations
COPY ./Labelbase/mysql/init.sql /docker-entrypoint-initdb.d/init.sql
Expand All @@ -37,8 +42,10 @@ WORKDIR /app
COPY ./Labelbase/django /app/

# Python deps
RUN pip install --upgrade pip --break-system-packages
RUN pip install --no-cache-dir --break-system-packages -r /app/requirements.txt
RUN ln -sf /usr/bin/python3.11 /usr/bin/python
RUN python -m pip install --upgrade pip
RUN python -m pip install --no-cache-dir --break-system-packages -r /app/requirements.txt

COPY ./run.sh /app/run.sh
RUN chmod +x /app/run.sh

11 changes: 11 additions & 0 deletions docker_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

echo "Running mysql"
mysqld &

echo "Running Labelbase"
/app/run.sh &

echo "Running nginx"
nginx -g 'daemon off;'

2 changes: 1 addition & 1 deletion manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ assets:
main:
type: docker
image: main
entrypoint: "/app/run.sh"
entrypoint: "docker_entrypoint.sh"
args: []
mounts:
main: /root
Expand Down
Loading