50 lines
1.2 KiB
Docker
50 lines
1.2 KiB
Docker
# Dockerfile
|
|
# Use an existing docker image as a base
|
|
FROM repo.n64.cc:443/nosial/ncc:debian as builder
|
|
|
|
# Metadata
|
|
LABEL maintainer="Netkas <netkas@nosial.net>"
|
|
LABEL version="1.0"
|
|
LABEL description="Keybert"
|
|
|
|
# Set working directory in the container
|
|
WORKDIR /keybert
|
|
|
|
# Increase PHP memory limit
|
|
RUN echo "memory_limit=-1" > /usr/local/etc/php/conf.d/memory-limit.ini
|
|
|
|
# Copy local code to the container
|
|
COPY . ./
|
|
|
|
# Install build dependencies for numpy and scipy
|
|
RUN apt-get update && apt-get install -y \
|
|
zip \
|
|
unzip \
|
|
build-essential \
|
|
gfortran \
|
|
python3 \
|
|
python3-pip \
|
|
python3-dev \
|
|
python3-venv
|
|
|
|
# Create a Python virtual environment
|
|
RUN python3 -m venv /opt/venv
|
|
# Make sure we use the virtualenv:
|
|
ENV PATH="/opt/venv/bin:$PATH"
|
|
|
|
# Install aiohttp and Keybert
|
|
RUN pip install --upgrade pip \
|
|
&& pip install aiohttp keybert
|
|
|
|
# Build and install Keybert
|
|
RUN ncc build --build-configuration release --log-level debug \
|
|
&& ncc package install -p "build/release/net.nosial.keybert.ncc" --log-level debug -y
|
|
|
|
# Clean up unnecessary files
|
|
RUN rm -rf /keybert
|
|
|
|
# Set working directory in the container
|
|
WORKDIR /
|
|
|
|
# Execute focuscrawler
|
|
CMD ["ncc", "exec", "--package", "net.nosial.keybert", "--exec-unit", "main", "--exec-args", "run"]
|