-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.dev
More file actions
60 lines (49 loc) · 1.52 KB
/
Dockerfile.dev
File metadata and controls
60 lines (49 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM ruby:3.4.2-bullseye
LABEL org.opencontainers.image.source=https://github.com/internetee/whois
LABEL org.opencontainers.image.description="WHOIS server for .ee domains (Development)"
LABEL org.opencontainers.image.licenses=MIT
# Install system dependencies and locales
RUN apt-get update && apt-get install -y \
build-essential \
libssl-dev \
libpq-dev \
libsystemd-dev \
whois \
locales \
netcat \
git \
vim \
curl \
&& echo "et_EE.UTF-8 UTF-8" > /etc/locale.gen \
&& locale-gen \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Set environment variables
ENV LANG=et_EE.UTF-8 \
LANGUAGE=et_EE:et \
LC_ALL=et_EE.UTF-8 \
DEBIAN_FRONTEND=noninteractive \
RAILS_ENV=development \
BUNDLE_PATH=/usr/local/bundle
# Create directories
RUN mkdir -p /opt/webapps/app/tmp/pids /opt/webapps/app/log
# Set working directory
WORKDIR /opt/webapps/app
# Copy Gemfile for dependency installation
COPY Gemfile Gemfile.lock ./
# Install dependencies with development gems
RUN gem update --system && \
gem install bundler && \
gem install pry-byebug && \
bundle config set --local specific_platform true && \
bundle install --jobs 20 --retry 5 && \
bundle lock --add-platform x86_64-linux
# Copy the rest of the application code
COPY . .
# Expose WHOIS port
EXPOSE 43
# Health check
HEALTHCHECK --interval=30s --timeout=3s \
CMD nc -zv localhost 43 || exit 1
# Start the WHOIS server with development settings
CMD ["bundle", "exec", "ruby", "whois.rb", "start"]