From 5301123508f22603b51bc5d576f2df673d407a9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Wed, 31 Oct 2018 16:07:28 +0100 Subject: [PATCH] add dockerfile for creating conan server image --- conan/Dockerfile | 27 +++++++++++++++++++++++++++ conan/Makefile | 14 ++++++++++++++ conan/entrypoint.sh | 6 ++++++ 3 files changed, 47 insertions(+) create mode 100644 conan/Dockerfile create mode 100644 conan/Makefile create mode 100644 conan/entrypoint.sh diff --git a/conan/Dockerfile b/conan/Dockerfile new file mode 100644 index 0000000..56b76b3 --- /dev/null +++ b/conan/Dockerfile @@ -0,0 +1,27 @@ +FROM python:alpine +MAINTAINER Jakub SokoĊ‚owski + +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"] diff --git a/conan/Makefile b/conan/Makefile new file mode 100644 index 0000000..7b44665 --- /dev/null +++ b/conan/Makefile @@ -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) diff --git a/conan/entrypoint.sh b/conan/entrypoint.sh new file mode 100644 index 0000000..5e391c3 --- /dev/null +++ b/conan/entrypoint.sh @@ -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