temp rearrange server Dockerfile so cache is used for fast dev cycle

This commit is contained in:
Deka Jello 2024-04-14 10:14:37 -05:00
parent 6a0d5741c3
commit e39781748b
5 changed files with 15 additions and 10 deletions

3
.gitignore vendored
View file

@ -13,3 +13,6 @@ server/**/lib/
server/**/bin/
server/**/pyvenv.cfg
__pycache__/
.vscode
docker-compose.dev.yml

View file

@ -1,3 +1,4 @@
ARG BUILDPLATFORM=linux/amd64
FROM --platform=$BUILDPLATFORM node:lts as builder
WORKDIR /opt/app

View file

@ -1,5 +1,5 @@
ARG ALPINE_VERSION=3.13
ARG BUILDPLATFORM=linux/amd64
FROM alpine:$ALPINE_VERSION as prereqs
WORKDIR /opt/app
@ -26,7 +26,6 @@ RUN apk --no-cache add \
py3-pyrfc3339
RUN pip3 install --no-cache-dir --disable-pip-version-check \
"alembic>=0.8.5" \
"alembic_utils>=0.5.6" \
"coloredlogs==5.0" \
"pyheif==0.6.1" \
"heif-image-plugin>=0.3.2" \
@ -34,8 +33,7 @@ RUN pip3 install --no-cache-dir --disable-pip-version-check \
"pillow-avif-plugin~=1.1.0"
RUN apk --no-cache del py3-pip
COPY ./ /opt/app/
RUN rm -rf /opt/app/szurubooru/tests
FROM --platform=$BUILDPLATFORM prereqs as testing
@ -74,8 +72,12 @@ RUN apk --no-cache add \
py3-waitress \
&& mkdir -p /opt/app /data \
&& addgroup -g ${PGID} app \
&& adduser -SDH -h /opt/app -g '' -G app -u ${PUID} app \
&& chown -R app:app /opt/app /data
&& adduser -SDH -h /opt/app -g '' -G app -u ${PUID} app
COPY ./ /opt/app/
RUN chown -R app:app /opt/app /data
USER app
CMD ["/opt/app/docker-start.sh"]

View file

@ -13,4 +13,3 @@ pytz>=2018.3
pyyaml>=3.11
SQLAlchemy>=1.0.12, <1.4
yt-dlp
alembic_utils>=0.5.6

View file

@ -11,7 +11,7 @@ import sys
from time import sleep
import alembic
from alembic_utils.replaceable_entity import register_entities
#from alembic_utils.replaceable_entity import register_entities
import sqlalchemy as sa
@ -23,8 +23,8 @@ sys.path.append(os.path.join(dir_to_self, *[os.pardir] * 2))
import szurubooru.config # noqa: E402
import szurubooru.model.base # noqa: E402
from szurubooru.migrations.functions import get_pool_posts_around # noqa: E402
register_entities([get_pool_posts_around])
#from szurubooru.migrations.functions import get_pool_posts_around # noqa: E402
#register_entities([get_pool_posts_around])
# fmt: on