Dockerfile-base 1.45 KB
Newer Older
1
# -*- coding: utf-8 -*-
2
3
#
# This file is part of CERN Search.
Carina Antunes's avatar
Carina Antunes committed
4
# Copyright (C) 2018-2021 CERN.
5
#
6
# Citadel Search is free software; you can redistribute it and/or modify it
7
# under the terms of the MIT License; see LICENSE file for more details.
8

Carina Antunes's avatar
Carina Antunes committed
9
10
# Use CentOS8:
FROM inveniosoftware/centos8-python:3.8
11

Carina Antunes's avatar
Carina Antunes committed
12
# Install pre-requisites
Carina Antunes's avatar
Carina Antunes committed
13
RUN yum update -y && yum install -y \
14
15
16
        gcc \
        openssl \
        openldap-devel \
Carina Antunes's avatar
Carina Antunes committed
17
18
19
        https://linuxsoft.cern.ch/cern/centos/8/CERN/x86_64/Packages/CERN-CA-certs-20200530-1.el8.cern.noarch.rpm \
        mailcap

Carina Antunes's avatar
Carina Antunes committed
20
21
22
23
# Uninstall python3.6 due to poetry bug (and leave node)
# https://github.com/python-poetry/poetry/issues/3463
RUN rpm -e --nodeps python36 && node -v

Carina Antunes's avatar
Carina Antunes committed
24
# Symlink python
Carina Antunes's avatar
Carina Antunes committed
25
RUN ln -nsf /usr/bin/python3.8 /usr/bin/python && python -V && whereis python
26
27
28

# CERN Search installation
WORKDIR /${WORKING_DIR}/src
Carina Antunes's avatar
Carina Antunes committed
29
COPY poetry.lock pyproject.toml /${WORKING_DIR}/src/
30
31

# Install dependencies globally
Carina Antunes's avatar
Carina Antunes committed
32
33
34
35
# Still using get-poetry due to https://github.com/python-poetry/poetry/issues/3870
# RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | POETRY_VERSION=1.1.6 python
# ENV PATH="${PATH}:/root/.local/bin"
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | POETRY_VERSION=1.1.6 python
Carina Antunes's avatar
Carina Antunes committed
36
37
ENV PATH="${PATH}:/root/.poetry/bin"

Carina Antunes's avatar
Carina Antunes committed
38
RUN poetry --version && poetry config virtualenvs.create false -vvv && \
Carina Antunes's avatar
Carina Antunes committed
39
    poetry install --no-root --no-dev --no-interaction --no-ansi