nucleic / enaml

Declarative User Interfaces for Python
http://enaml.readthedocs.io/en/latest/
Other
1.53k stars 130 forks source link

Enaml in docker #446

Closed youpsla closed 3 years ago

youpsla commented 3 years ago

Hello, I'm trying to install enaml-web inside a docker container. I post here because enaml-web uses Enaml and I think my issue is related to enaml.

I have no problem building the image but when running the container, have the following issue: WARNING: Couldn't write lextab module 'enaml.core.parser.parse_tab.lextab36'. [Errno 13] Permission denied: '/usr/local/lib/python3.9/site-packages/enaml/core/parser/parse_tab/lextab36.py'

Any idea if it's possible to create modules in parse_tab during the initial pip install process ?

frmdstryr commented 3 years ago

Any idea if it's possible to create modules in parse_tab during the initial pip install process ?

The setup script already does this at install time https://github.com/nucleic/enaml/blob/main/setup.py#L124 .

This is not an issue with enaml, it's something with permissions and however you're installing it on your container.

youpsla commented 3 years ago

Again, thanks for your answer.

It was a permissions issue.

I solved it by setting in Dockerfile:

RUN adduser -disabled-password worker

WORKDIR /website

# Install pip requirements
COPY --chown=worker:worker website/requirements.txt .

ENV PATH="/website/.local/bin:${PATH}"
RUN pip install --user -r requirements.txt

and now it works.