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

Create a docker image from devel branch #113

Open
gael-seroul opened this issue Dec 18, 2024 · 1 comment
Open

Create a docker image from devel branch #113

gael-seroul opened this issue Dec 18, 2024 · 1 comment

Comments

@gael-seroul
Copy link

Hi,
I can create a docker image with the latest image (1.0.2). I tried to create a docker image from the devel branch:

Dockerfile:

FROM python:3.8
LABEL description="Python 3.8 based image to run emhub application"
LABEL maintainer="J.M. de la Rosa Trevin delarosatrevin@gmail.com"
RUN pip install emhub
ENV EMHUB_INSTANCE /emhub-data
USER nobody
CMD [ "gunicorn", "-k", "gevent", "--workers=2", "emhub:create_app()", "--bind", "0.0.0.0:8080" ]

Run build command:
docker build . -t emhub:gael --no-cache

Start using docker compose file:

version: '3.3'

name: emhub

services:
    cryoEM:
        container_name: 'emhub-gael'
        image: emhub:gael
        restart: unless-stopped
        ports:
            - "8899:8080"
        volumes:
            - /home/crims/cryoEM/emhub-data-dev/:/emhub-data

EMHUB is running but the version shown at the bottom is still 1.0.2, from emhub directory if I run
gunicorn -k gevent --workers=2 'emhub:create_app()' --bind 0.0.0.0:8899
EMHUB is the right dev version (1.0.4rc2)

I guess this is coming from the command pip install emhub in Dockerfile, do you have any advice to create a docker image using devel branch ?

@delarosatrevin
Copy link
Member

Yes, it is because you are installing EMhub from the pip command. We recently were working on a Dockerfile for an image working from devel branch. Have a look at the following PR:

https://github.com/3dem/emhub/pull/106/files#diff-668945874df722bc94dc871adb29534329a1e565e51f3245fdbfb919822a0feb

You only need to build the image once and then restart it when there are new changes. Please check the users and directory where you will mount the instance. Be sure the EMHUB_INSTANCE is passed correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants