Skip to content

Commit

Permalink
Use alpine as main dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
j6k4m8 committed Feb 17, 2024
1 parent fc4db1e commit 1252184
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 43 deletions.
1 change: 0 additions & 1 deletion .github/workflows/docker-publish.yml
Expand Up @@ -20,7 +20,6 @@ jobs:
permissions:
contents: read
packages: write
#
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
42 changes: 37 additions & 5 deletions Dockerfile
@@ -1,6 +1,38 @@
FROM python:3.8
FROM alpine:3.12

RUN git clone https://github.com/j6k4m8/goosepaper
WORKDIR /goosepaper
RUN pip3 install -r ./requirements.txt
RUN pip3 install -e .
LABEL maintainer="Jordan Matelsky <goosepaper@matelsky.com>"
LABEL authors="Sergio Moura <sergio@moura.ca>"

RUN apk --update --no-cache add cairo libffi libjpeg libstdc++ libxml2 libxslt pango \
py3-aiohttp py3-cffi py3-feedparser py3-gobject3 py3-html5lib py3-lxml py3-multidict \
py3-numpy py3-requests py3-yarl ttf-dejavu

# Panda
ARG PANDAS_VERSION=1.1.5
RUN apk add --no-cache --virtual .build-deps curl build-base linux-headers py3-pip py3-numpy-dev python3-dev py3-setuptools && \
pip3 install cython && \
cd /tmp && \
curl -LO https://github.com/pandas-dev/pandas/releases/download/v${PANDAS_VERSION}/pandas-${PANDAS_VERSION}.tar.gz && \
tar zxf pandas-${PANDAS_VERSION}.tar.gz && \
cd pandas-${PANDAS_VERSION} && \
python3 setup.py build && \
python3 setup.py install --prefix=/usr && \
cd /tmp && \
rm -rf pandas-${PANDAS_VERSION}.tar.gz pandas-${PANDAS_VERSION} && \
pip3 uninstall -y cython && \
apk del .build-deps && \
rm -Rf /root/.cache

WORKDIR /app
COPY requirements.txt .
RUN apk add --no-cache --virtual .build-deps build-base git libxml2-dev libxslt-dev libffi-dev libjpeg-turbo-dev py3-pip py3-wheel python3-dev && \
pip3 install -r ./requirements.txt && \
apk del .build-deps && \
rm -Rf /root/.cache
COPY . .
RUN apk add --no-cache --virtual .install-deps py3-pip && \
pip3 install -e . && \
apk del .install-deps && \
rm -Rf /root/.cache

ENTRYPOINT ["goosepaper"]
37 changes: 0 additions & 37 deletions Dockerfile.alpine

This file was deleted.

0 comments on commit 1252184

Please sign in to comment.