Skip to content
Dockerfile 1.05 KiB
Newer Older
Aurélien Dunand's avatar
Aurélien Dunand committed
FROM pypy:2-5.10-slim

RUN groupadd -r cc-server && useradd --no-log-init -r -g cc-server cc-server \
Aurélien Dunand's avatar
Aurélien Dunand committed
        && install -d -o cc-server -g cc-server /var/lib/cc-server
Aurélien Dunand's avatar
Aurélien Dunand committed
VOLUME ["/var/lib/cc-server"]
WORKDIR /opt/cc-server

COPY requirements.txt .
COPY README .
COPY setup.py .
COPY bin ./bin
COPY cloudcontrol ./cloudcontrol
RUN set -ex \
        && buildDeps=' \
        build-essential \
        git \
        ' \
        && apt-get -y update && apt-get install -y --no-install-recommends $buildDeps ssl-cert \
        && pip install --no-cache-dir -r requirements.txt -e . \
        && find /usr/local \
        \( -type d -a -name test -o -name tests \) \
        -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
        -exec rm -rf '{}' + \
        && apt-get purge -y --auto-remove $buildDeps \
        && apt-get clean && rm -rf /var/lib/apt/lists/*

COPY docker-entrypoint.sh .
COPY etc/cc-server.conf.docker /etc/cc-server.conf
ENTRYPOINT ["./docker-entrypoint.sh"]
Aurélien Dunand's avatar
Aurélien Dunand committed
CMD ["pypy", "./bin/cc-server", "-s", "-f", "-u", "cc-server", "-g", "cc-server"]
Aurélien Dunand's avatar
Aurélien Dunand committed
EXPOSE 1984