Skip to content

Commit

Permalink
v0.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
nvoynov committed Dec 12, 2023
1 parent 0ac4bbb commit 8d860de
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 9 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ title: Punch Changelog

## [Unreleased]

## [0.6.4] - 2023-12-09
## [0.6.4] - 2023-12-12

- moved to Ruby 3.2.2
- moved to Ruby 3.2.2 (Psych and Tests)
- added .dockerignore
- added doker.rake
- changed Dockerfile

## [0.6.3] - 2023-01-24

Expand Down
12 changes: 12 additions & 0 deletions lib/assets/starter/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Ignore all
*

# Allow sources
!/exe/service.rb
!/app
!/lib
# !Gemfile
# !Gemfile.lock

# Ignore inside sources
**/*~
13 changes: 7 additions & 6 deletions lib/assets/starter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ruby:latest
WORKDIR /usr/src/app/
RUN bundle install
ADD . /usr/src/app/
EXPOSE 3333
CMD ["ruby", "/usr/src/app/hello.rb"]
FROM ruby:3.2.2
WORKDIR /app
# COPY Gemfile Gemfile.lock .
# ENV BUNDLER_WITHOUT development test
# RUN gem update --system && bundle install
ADD . .
CMD ["ruby", "/app/exe/service.rb"]
3 changes: 2 additions & 1 deletion lib/assets/starter/Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require "rake"
require "rake/testtask"
Rake.application.rake_require "docker", ["."]

Rake::TestTask.new(:test) do |t|
t.libs << "test"
Expand Down
24 changes: 24 additions & 0 deletions lib/assets/starter/docker.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace :docker do

DOCKER = 'docker'.freeze

desc 'Up mounted /app'
task :local do
# for Docker on Windows, add folder (Settings->Resources->File Sharing) and retart Docker
# docker run --rm -it --mount type=bind,source=.,destination=/app ruby:3.2.2 /bin/sh
system "#{DOCKER} run --rm -it --mount type=bind,source=.,destination=/app ruby:3.2.2 /bin/sh"
end

desc "Build Docker Image"
task :build, :tag do |t, args|
args.with_defaults(tag: 'dummy')
system "#{DOCKER} build . -t #{args.tag}"
end

desc "Run Docker Image"
task :run, :command do |t, args|
args.with_defaults(command: '') # /bin/sh
system "#{DOCKER} run --rm -it --mount type=bind,source=.,destination=/app dummy #{args.command}"
end

end

0 comments on commit 8d860de

Please sign in to comment.