mirror of
https://github.com/tubearchivist/tubearchivist-server.git
synced 2024-11-13 23:50:12 +00:00
better build, multi stage, passing args in compose
This commit is contained in:
parent
1a32b0a51d
commit
35a90941ff
@ -12,7 +12,10 @@ services:
|
||||
# main flask site
|
||||
tubearchivist:
|
||||
container_name: tubearchivist
|
||||
build: ./tubearchivist/web
|
||||
build:
|
||||
context: ./tubearchivist/web
|
||||
args:
|
||||
- INSTALL_DEBUG=1
|
||||
restart: always
|
||||
volumes:
|
||||
- ./volume/tubearchivist/data:/data
|
||||
|
@ -1,12 +1,26 @@
|
||||
FROM python:3.10.8-slim-bullseye
|
||||
# builder
|
||||
FROM python:3.10.8-slim-bullseye as builder
|
||||
|
||||
RUN apt-get clean && apt-get -y update && \
|
||||
apt-get -y install --no-install-recommends \
|
||||
build-essential libpq-dev vim htop bmon net-tools iputils-ping procps
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential
|
||||
|
||||
ENV PATH=/root/.local/bin:$PATH
|
||||
COPY requirements.txt /requirements.txt
|
||||
RUN pip install --upgrade pip && pip install --user -r requirements.txt
|
||||
RUN pip install --user -r requirements.txt
|
||||
|
||||
# final
|
||||
FROM python:3.10.8-slim-bullseye as tubearchivist-web
|
||||
|
||||
ARG INSTALL_DEBUG
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
COPY --from=builder /root/.local /root/.local
|
||||
ENV PATH=/root/.local/bin:$PATH
|
||||
|
||||
RUN if [ "$INSTALL_DEBUG" ] ; then \
|
||||
apt-get -y update && apt-get -y install --no-install-recommends \
|
||||
vim htop bmon net-tools iputils-ping procps \
|
||||
&& pip install --user ipython \
|
||||
; fi
|
||||
|
||||
RUN mkdir /data
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
APScheduler==3.9.1.post1
|
||||
beautifulsoup4==4.11.1
|
||||
flask==2.2.2
|
||||
ipython==8.7.0
|
||||
markdown==3.4.1
|
||||
psycopg2==2.9.5
|
||||
psycopg2-binary==2.9.5
|
||||
redis==4.4.0
|
||||
requests==2.28.1
|
||||
uWSGI==2.0.21
|
||||
|
Loading…
Reference in New Issue
Block a user