Reduce image size to 865MB

This commit is contained in:
Damian Fajfer
2024-04-05 18:45:49 +02:00
parent 645e81b917
commit 4a60712a6c
2 changed files with 7 additions and 5 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*__pycache__**
*~

View File

@@ -1,14 +1,15 @@
FROM docker.io/ubuntu:jammy-20240227 FROM docker.io/ubuntu:jammy-20240227
RUN apt-get update && apt-get install -y wget gpg xvfb libgbm-dev libasound2 python3-pip && \ RUN apt-get update && apt-get install --no-install-recommends -y wget gpg xvfb libgbm-dev libasound2 python3-pip && \
wget -qO- https://gcups-static.greencell.global/csgsa-keyring.gpg | gpg --dearmor | dd of=/usr/share/keyrings/csgsa-keyring.gpg && \ wget -qO- https://gcups-static.greencell.global/csgsa-keyring.gpg | gpg --dearmor | dd of=/usr/share/keyrings/csgsa-keyring.gpg && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/csgsa-keyring.gpg] https://gcups-static.greencell.global/deb stable non-free" | dd of=/etc/apt/sources.list.d/gcups.list && \ echo "deb [arch=amd64 signed-by=/usr/share/keyrings/csgsa-keyring.gpg] https://gcups-static.greencell.global/deb stable non-free" | dd of=/etc/apt/sources.list.d/gcups.list && \
apt-get update -y && apt-get install -y gcups && \ apt-get update -y && apt-get install --no-install-recommends -y gcups && \
rm -rf var/lib/apt/lists/* && \ rm -rf var/lib/apt/lists/* && \
python3 -m pip install plyvel && \ python3 -m pip --no-cache-dir install plyvel && \
apt-get remove -y python3-pip && \ apt-get remove -y python3-pip && \
mkdir -m775 -p /opt/gcups/db/gcups-rxdb-1-settings mkdir -m775 -p /opt/gcups/db/gcups-rxdb-1-settings
COPY populate-db.py db.txt ./ COPY init.sh populate-db.py db.txt /opt/
WORKDIR /opt
RUN python3 populate-db.py RUN python3 populate-db.py
ENV GCUPS_HTTP_PORT=8080 ENV GCUPS_HTTP_PORT=8080
@@ -16,5 +17,4 @@ ENV GCUPS_PASSWORD=gcups123
EXPOSE $GCUPS_HTTP_PORT EXPOSE $GCUPS_HTTP_PORT
COPY init.sh /opt/init.sh
ENTRYPOINT ["/opt/init.sh"] ENTRYPOINT ["/opt/init.sh"]