forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add dockerfile for ror, fix template issue (OpenAPITools#718)
- Loading branch information
Showing
10 changed files
with
142 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
modules/openapi-generator/src/main/resources/ruby-on-rails-server/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM ruby:2.5-alpine | ||
|
||
ENV BUILD_PACKAGES="curl-dev ruby-dev build-base" \ | ||
DEV_PACKAGES="zlib-dev libxml2-dev libxslt-dev tzdata yaml-dev sqlite-dev" \ | ||
RUBY_PACKAGES="ruby-json yaml nodejs" | ||
|
||
RUN apk update && \ | ||
apk upgrade && \ | ||
apk add --no-cache --update\ | ||
$BUILD_PACKAGES \ | ||
$DEV_PACKAGES \ | ||
$RUBY_PACKAGES && \ | ||
mkdir -p /usr/src/myapp | ||
|
||
WORKDIR /usr/src/myapp | ||
|
||
COPY Gemfile ./ | ||
RUN gem install bundler | ||
RUN bundle config build.nokogiri --use-system-libraries && \ | ||
bundle install --jobs=4 --retry=10 --clean | ||
|
||
COPY . ./ | ||
RUN chmod +x bin/rails | ||
|
||
COPY docker-entrypoint.sh /usr/local/bin/ | ||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh | ||
ENTRYPOINT ["docker-entrypoint.sh"] | ||
|
||
CMD ["bin/rails", "s", "-b", "0.0.0.0"] |
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions
9
modules/openapi-generator/src/main/resources/ruby-on-rails-server/docker-entrypoint.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
if [ "$1" = 'bin/rails' ] && [ "$2" = 's' ]; then | ||
rm -f /myapp/tmp/pids/server.pid | ||
bin/rails db:migrate | ||
fi | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM ruby:2.5-alpine | ||
|
||
ENV BUILD_PACKAGES="curl-dev ruby-dev build-base" \ | ||
DEV_PACKAGES="zlib-dev libxml2-dev libxslt-dev tzdata yaml-dev sqlite-dev" \ | ||
RUBY_PACKAGES="ruby-json yaml nodejs" | ||
|
||
RUN apk update && \ | ||
apk upgrade && \ | ||
apk add --no-cache --update\ | ||
$BUILD_PACKAGES \ | ||
$DEV_PACKAGES \ | ||
$RUBY_PACKAGES && \ | ||
mkdir -p /usr/src/myapp | ||
|
||
WORKDIR /usr/src/myapp | ||
|
||
COPY Gemfile ./ | ||
RUN gem install bundler | ||
RUN bundle config build.nokogiri --use-system-libraries && \ | ||
bundle install --jobs=4 --retry=10 --clean | ||
|
||
COPY . ./ | ||
RUN chmod +x bin/rails | ||
|
||
COPY docker-entrypoint.sh /usr/local/bin/ | ||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh | ||
ENTRYPOINT ["docker-entrypoint.sh"] | ||
|
||
CMD ["bin/rails", "s", "-b", "0.0.0.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
if [ "$1" = 'bin/rails' ] && [ "$2" = 's' ]; then | ||
rm -f /myapp/tmp/pids/server.pid | ||
bin/rails db:migrate | ||
fi | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.opoenapitools</groupId> | ||
<artifactId>RORPetstoreServerTests</artifactId> | ||
<packaging>pom</packaging> | ||
<version>1.0-SNAPSHOT</version> | ||
<name>ROR Petstore Server</name> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>copy-dependencies</goal> | ||
</goals> | ||
<configuration> | ||
<outputDirectory>${project.build.directory}</outputDirectory> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>1.2.1</version> | ||
<executions> | ||
<execution> | ||
<id>bundle-install</id> | ||
<phase>pre-integration-test</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>bundle</executable> | ||
<arguments> | ||
<argument>install</argument> | ||
<argument>--path</argument> | ||
<argument>vendor/bundle</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
<!--<execution> | ||
<id>bundle-test</id> | ||
<phase>integration-test</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>bundle</executable> | ||
<arguments> | ||
<argument>exec</argument> | ||
<argument>rspec</argument> | ||
</arguments> | ||
</configuration> | ||
</execution>--> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |