Skip to content

Commit

Permalink
[Dockerfile][s]: Fixes pip installation and other minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammadIsmailShahzad committed May 31, 2021
1 parent 230f78a commit ffa86f5
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions rootfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ RUN apk add --no-cache \
libtool \
musl-dev \
pcre-dev \
pcre \
python-dev

# Create the src directory
RUN mkdir -p ${SRC_DIR}

# Install pip
RUN curl -o ${SRC_DIR}/get-pip.py https://bootstrap.pypa.io/get-pip.py && \
python ${SRC_DIR}/get-pip.py
RUN curl -o ${SRC_DIR}/get-pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py && \
python ${SRC_DIR}/get-pip.py pip==20.3.3

# Fetch and build CKAN and requirements
RUN pip install -e git+${GIT_URL}@${GIT_BRANCH}#egg=ckan
Expand All @@ -55,32 +56,34 @@ ENV SRC_DIR=/srv/app/src
ENV PIP_SRC=${SRC_DIR}
ENV CKAN_SITE_URL=http://localhost:5000
ENV CKAN__PLUGINS image_view text_view recline_view datastore datapusher envvars
ENV CKAN__VIEWS__DEFAULT_VIEWS dataexplorer

WORKDIR ${APP_DIR}

# Install necessary packages to run CKAN
RUN apk add --no-cache git \
bash \
gettext \
linux-headers \
curl \
postgresql-client \
python \
libmagic \
pcre \
apache2-utils && \
# Create SRC_DIR
mkdir -p ${SRC_DIR}

# Install pip
RUN curl -o ${SRC_DIR}/get-pip.py https://bootstrap.pypa.io/get-pip.py && \
python ${SRC_DIR}/get-pip.py
RUN curl -o ${SRC_DIR}/get-pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py && \
python ${SRC_DIR}/get-pip.py pip==20.3.3

# Get artifacts from build stages
COPY --from=ckanbuild /wheels /srv/app/wheels
COPY --from=ckanbuild /srv/app/src/ckan /srv/app/src/ckan

# Copy necessary scripts
COPY setup/app ${APP_DIR}

# Additional install steps for build stages artifacts
RUN pip install --no-index --find-links=/srv/app/wheels uwsgi gevent

Expand Down Expand Up @@ -109,8 +112,6 @@ RUN mkdir -p /docker-entrypoint.d

EXPOSE 5000

HEALTHCHECK --interval=10s --timeout=5s --retries=5 CMD curl --fail http://localhost:5000/api/3/action/status_show || exit 1

USER ckan

CMD ["/srv/app/start_ckan.sh"]

0 comments on commit ffa86f5

Please sign in to comment.