Skip to content

Commit be7120c

Browse files
authored
Merge pull request #427 from internetee/add-dockerfile
Updated dockerfile and renovate.json
2 parents 2c3b1c1 + a3d60d7 commit be7120c

File tree

4 files changed

+110
-3
lines changed

4 files changed

+110
-3
lines changed

.dockerignore

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Git
2+
.git
3+
.gitignore
4+
.github
5+
6+
# Docker
7+
Dockerfile
8+
Dockerfile.*
9+
docker-compose.yml
10+
.dockerignore
11+
12+
# Rails
13+
.bundle
14+
log/*
15+
tmp/*
16+
storage/*
17+
public/assets
18+
public/packs
19+
node_modules
20+
yarn-error.log
21+
22+
# Environment
23+
.env
24+
.env.*
25+
config/master.key
26+
config/credentials.yml.enc
27+
28+
# Documentation
29+
README.md
30+
CHANGELOG.md
31+
LICENSE
32+
*.md
33+
34+
# Development and test files
35+
spec/
36+
test/
37+
features/
38+
coverage/
39+
.rspec
40+
.rubocop.yml
41+
.ruby-version
42+
.byebug_history
43+
44+
# OS specific
45+
.DS_Store
46+
Thumbs.db
47+
48+
# Editor directories and files
49+
.idea
50+
.vscode
51+
*.swp
52+
*.swo
53+
*~

Dockerfile.production

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Base image with platform specification
2+
FROM internetee/ruby:3.0-buster
3+
4+
# Set working directory
5+
WORKDIR /opt/webapps/app
6+
7+
# Set production environment
8+
ENV RAILS_ENV="production" \
9+
RAILS_LOG_TO_STDOUT=true \
10+
BUNDLE_DEPLOYMENT="1" \
11+
BUNDLE_PATH="/usr/local/bundle" \
12+
LANG=et_EE.UTF-8 \
13+
LANGUAGE=et_EE:et \
14+
LC_ALL=et_EE.UTF-8
15+
16+
# Fix repository issues and install packages
17+
RUN apt-get update -qq || true && \
18+
apt-get install -y --no-install-recommends gnupg2 && \
19+
# Remove problematic repositories
20+
rm -f /etc/apt/sources.list.d/google-chrome.list && \
21+
rm -f /etc/apt/sources.list.d/pgdg.list && \
22+
# Update sources and install packages
23+
apt-get update -qq && \
24+
apt-get install --no-install-recommends -y \
25+
netcat \
26+
curl \
27+
libpq-dev \
28+
imagemagick \
29+
shared-mime-info \
30+
&& apt-get clean \
31+
&& rm -rf /var/lib/apt/lists/*
32+
33+
# Copy Gemfile and install dependencies
34+
COPY Gemfile Gemfile.lock ./
35+
RUN bundle config set --local without 'development test' && \
36+
bundle install --jobs 20 --retry 5 && \
37+
bundle clean --force
38+
39+
# Copy application code
40+
COPY . .
41+
42+
# Precompile assets
43+
RUN RAILS_ENV=production bundle exec rake assets:precompile
44+
45+
# Expose Rails port
46+
EXPOSE 3000
47+
48+
# Health check for Rails
49+
# HEALTHCHECK --interval=30s --timeout=3s \
50+
# CMD curl -f http://localhost:3000/health || exit 1
51+
52+
# Start the Rails server
53+
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]

renovate.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
},
1515
{
1616
"matchDepTypes": [".ruby-version"],
17-
"addLabels": ["ruby-version"]
17+
"addLabels": ["ruby-version"],
18+
"automerge": false
1819
}
1920
],
2021
"docker": {

test/integration/whois_records/json_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def test_hide_sensitive_data_of_legal_entity_when_captcha_is_unsolved
125125
response_json = JSON.parse(response.body, symbolize_names: true)
126126

127127
assert_equal 'Not Disclosed - Visit www.internet.ee for web-based WHOIS', response_json[:email]
128-
assert_equal 'Not Disclosed - Visit www.internet.ee for web-based WHOIS', response_json[:phone]
128+
assert_equal 'Not Disclosed', response_json[:phone]
129129

130130
expected_admin_contacts = [
131131
{ name: 'Not Disclosed - Visit www.internet.ee for web-based WHOIS',
@@ -233,7 +233,7 @@ def test_hide_sensitive_data_of_legal_entity_when_ip_is_not_in_whitelist
233233
response_json = JSON.parse(response.body, symbolize_names: true)
234234

235235
assert_equal 'Not Disclosed - Visit www.internet.ee for web-based WHOIS', response_json[:email]
236-
assert_equal 'Not Disclosed - Visit www.internet.ee for web-based WHOIS', response_json[:phone]
236+
assert_equal 'Not Disclosed', response_json[:phone]
237237
assert_equal 'Not Disclosed - Visit www.internet.ee for web-based WHOIS',
238238
response_json[:registrant_changed]
239239

0 commit comments

Comments
 (0)