docker: use platform-specific dockerize build - fixes #43

This commit is contained in:
Eugene Pankov 2022-01-27 11:01:07 +01:00
parent 533ad46c96
commit 5d94835d7d
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
3 changed files with 13 additions and 4 deletions

View File

@ -43,8 +43,15 @@ RUN FRONTEND_BUILD_DIR=/frontend /venv/*/bin/python ./manage.py add_version ${BU
FROM python:3.7-alpine AS backend
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait /wait
RUN chmod +x /wait
ENV DOCKERIZE_VERSION v0.6.1
ARG TARGETPLATFORM
RUN if [ "$TARGETPLATFORM" = "arm64" ]; \
then export DOCKERIZE_ARCH=armhf; \
else export DOCKERIZE_ARCH=amd64; \
fi
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-$DOCKERIZE_ARCH-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-$DOCKERIZE_ARCH-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-$DOCKERIZE_ARCH-$DOCKERIZE_VERSION.tar.gz
RUN apk add mariadb-connector-c

View File

@ -1,5 +1,7 @@
#!/bin/sh
/wait
if [ -z "$var" ]; then
dockerize $DOCKERIZE_ARGS
fi
cd /app
/venv/*/bin/python ./manage.py migrate
/venv/*/bin/gunicorn

View File

@ -14,7 +14,7 @@ services:
- ENABLE_HOMEPAGE=False
- DEBUG=False
- APP_DIST_STORAGE=file:///app-dist
- WAIT_HOSTS=db:3306
- DOCKERIZE_ARGS="-wait tcp://db:3306 -timeout 60s"
db:
image: mariadb:10.7.1