Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Dockerfile #39

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ui_*
build/
dist/
package/
data/
icons/DDG_icon
doc/
extra_tools/
translations/*.sh
.vscode/
__pycache__/
setup.cfg
66 changes: 66 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Stolen from https://github.com/dasycarpum/docker-pyqt6/blob/main/docker/Dockerfile

# Use Ubuntu as the base image
FROM ubuntu:23.10

# Combine ENV statements
ENV DEBIAN_FRONTEND=noninteractive \
LIBGL_ALWAYS_INDIRECT=1 \
QT_DEBUG_PLUGINS=1 \
QT_QUICK_BACKEND=software

# Add user
RUN apt-get update && apt-get install -y adduser \
&& adduser --quiet --disabled-password --gecos '' qtuser \
&& rm -rf /var/lib/apt/lists/*

# Set the working directory in the container
WORKDIR /usr/src/app

# Install Python 3 and PyQt6
RUN apt-get update && apt-get install -y \
python3-pip \
libgl1-mesa-dev \
libxkbcommon-x11-0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-xinerama0 \
libxcb-xinput0 \
libxcb-xfixes0 \
libxcb-shape0 \
libxcb-render0 \
libxcb-glx0 \
libxi6 \
libxkbfile1 \
libxcb-cursor0 \
# For QtWebEngine
libqt5webenginecore5 \
libqt5webchannel5 \
qtwebengine5-dev \
&& rm -rf /var/lib/apt/lists/*

# Install dependencies
COPY requirements.txt ./
RUN pip install --no-cache-dir --break-system-packages -r requirements.txt

# Copy the application code into the container
COPY ./ ./

# Set the main script as the container's entrypoint
CMD ["python3", "./main.py"]

# docker build -t dotdotgoose .
# xhost +
# docker run --rm -it \
# -v /tmp/.X11-unix:/tmp/.X11-unix \
# -v $HOME:$HOME \
# -e PYTHONPATH=/usr/src/app \
# -e DISPLAY=$DISPLAY \
# -e QT_QPA_PLATFORM=xcb \
# --user $(id -u):$(id -g) \
# dotdotgoose
# xhost -

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ python3 main.py

## Executables

Don't want to install from scratch? [Download DotDotGoose and start counting!](https://biodiversityinformatics.amnh.org/open_source/dotdotgoose/)
Don't want to install from scratch? [Download DotDotGoose and start counting!](https://biodiversityinformatics.amnh.org/open_source/dotdotgoose/)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
numpy==1.26.4
Pillow==10.3.0
PyQt6==6.7.1
PyQt6==6.7.0