Skip to content

Commit

Permalink
Reducing image size to 781MB
Browse files Browse the repository at this point in the history
  • Loading branch information
fajfer committed Apr 6, 2024
1 parent dae79e0 commit b9966df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Table of Contents
* [Docker-compose](#docker-compose)
* [Versioning](#versioning)
* [FAQ](#faq)
* [TODOs](#todos)

## Quick Start
For testing purposes (to see if this thing works on your machine) you can run the container in `privileged` mode but this is not recommended, [read](https://learn.snyk.io/lesson/container-runs-in-privileged-mode/).
Expand Down Expand Up @@ -114,5 +113,3 @@ If you are getting the following error:
/opt/gcups/gcups[101]: ../../third_party/electron_node/src/node_api.cc:1332:napi_status napi_release_threadsafe_function(napi_threadsafe_function, napi_threadsafe_function_release_mode): Assertion `(func) != nullptr' failed.
```
Then you have your UPS connected via USB and provided a wrong `--device` for the docker image. This will obviously make the HTTP server unable to start.
## TODOs
- Optimize image size (it's 1.31G as of now which I think is way too much)
7 changes: 4 additions & 3 deletions gcups/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ RUN apt-get update && apt-get install --no-install-recommends -y wget gpg xvfb l
python3 -m pip --no-cache-dir install plyvel && \
python3 -m pip --no-cache-dir uninstall setuptools wheel && \
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 && \
rm -rf /opt/gcups/license /opt/gcups/manuals

COPY init.sh populate-db.py db.txt /opt/
WORKDIR /opt
RUN python3 populate-db.py

ENV GCUPS_HTTP_PORT=8080 GCUPS_PASSWORD=gcups123

ENV GCUPS_HTTP_PORT=8080
ENV GCUPS_PASSWORD=gcups123
EXPOSE $GCUPS_HTTP_PORT

ENTRYPOINT ["/opt/init.sh"]

0 comments on commit b9966df

Please sign in to comment.