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

Dockerfile changes to run /apps/candlestick-patterns app #728

Open
dcorb opened this issue Jul 6, 2024 · 0 comments
Open

Dockerfile changes to run /apps/candlestick-patterns app #728

dcorb opened this issue Jul 6, 2024 · 0 comments

Comments

@dcorb
Copy link

dcorb commented Jul 6, 2024

It didn't work for me, got some help from chatGPT:

To make the original Dockerfile work on macOS, the minimal changes needed are to update the config.guess and config.sub scripts before running the configure script. Here is the modified Dockerfile:

Dockerfile

FROM python:3.8-slim

RUN apt-get -y update && apt-get -y install gcc curl make dos2unix

RUN pip install --upgrade pip
# Required by TA-Lib and numba
RUN pip install numpy>=1.19.4

RUN curl -O https://netcologne.dl.sourceforge.net/project/ta-lib/ta-lib/0.4.0/ta-lib-0.4.0-src.tar.gz \
    && tar -xzf ta-lib-0.4.0-src.tar.gz \
    && cd ta-lib/ \
    && curl -O https://git.savannah.gnu.org/cgit/config.git/plain/config.guess \
    && curl -O https://git.savannah.gnu.org/cgit/config.git/plain/config.sub \
    && chmod +x config.guess config.sub \
    && dos2unix config.guess config.sub \
    && ./configure --prefix=/usr \
    && make \
    && make install \
    && cd ..

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY assets ./assets
COPY app.py .

CMD ["python", "app.py"]

## Explanation of Changes

Install dos2unix: Added dos2unix to the list of packages installed by apt-get.
Update config.guess and config.sub:
Added steps to download the latest config.guess and config.sub scripts from the GNU repository.
Added steps to set the executable permissions for these scripts.
Added a step to convert line endings using dos2unix.
These changes ensure that the config.guess and config.sub scripts are up to date and compatible with the build environment, resolving issues related to cross-compilation and system recognition.

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

1 participant