add dockerfile for creating conan server image

This commit is contained in:
Jakub Sokołowski 2018-10-31 16:07:28 +01:00
parent de97de9732
commit 5301123508
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
3 changed files with 47 additions and 0 deletions

27
conan/Dockerfile Normal file
View File

@ -0,0 +1,27 @@
FROM python:alpine
MAINTAINER Jakub Sokołowski <jakub@status.im>
ENV CONAN_PORT 9300
ENV CONAN_WORKERS 4
ENV CONAN_TIMEOUT 300
ARG CONAN_VERSION
ARG GUNICORN_VERSION
# Install dependencies so they get cached with the image
VOLUME /var/lib/conan
RUN apk update && \
apk add musl-dev gcc && \
pip install --no-cache-dir \
conan==${CONAN_VERSION} \
gunicorn==${GUNICORN_VERSION}
# Run uwsgi listening on port 9300
EXPOSE ${CONAN_PORT}
LABEL source="https://github.com/status-im/infra-utils"
LABEL description="Conan server repository service"
LABEL maintainer="jakub@status.im"
COPY ./entrypoint.sh /entrypoint.sh
CMD ["/bin/sh", "/entrypoint.sh"]

14
conan/Makefile Normal file
View File

@ -0,0 +1,14 @@
CONAN_VERSION = 1.9.0
GUNICORN_VERSION = 19.9.0
IMAGE_TAG = latest
IMAGE_NAME = statusteam/conan:$(IMAGE_TAG)
build:
docker build \
--build-arg="CONAN_VERSION=$(CONAN_VERSION)" \
--build-arg="GUNICORN_VERSION=$(GUNICORN_VERSION)" \
-t $(IMAGE_NAME) .
push: build
docker push $(IMAGE_NAME)

6
conan/entrypoint.sh Normal file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env sh
gunicorn \
--bind=0.0.0.0:${CONAN_PORT} \
--workers=${CONAN_WORKERS} \
--timeout=${CONAN_TIMEOUT} \
conans.server.server_launcher:app