# SPDX-License-Identifier: MulanPSL-2.0+
# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.

FROM alpine:3.18

MAINTAINER Wu Zhende <wuzhende666@163.com>

RUN sed -ri.origin 's|^https?://dl-cdn.alpinelinux.org|http://mirrors.huaweicloud.com|g' /etc/apk/repositories

RUN apk update

RUN apk add --no-cache 'ruby-dev' \
    'g++' 'gcc' 'pcre' 'libevent' 'make' 'git' 'cpio' 'bash' 'linux-headers'

RUN umask 002 && \
    gem install console -v 1.15.3 && \
    gem sources -r https://rubygems.org/ -a https://gems.ruby-china.com/ && \
    gem install bundle

COPY Gemfile /
RUN bundle install --gemfile=/Gemfile

EXPOSE 24224 24224/udp
