-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3fa66aa
commit f26cc0b
Showing
3 changed files
with
71 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# vim:set ft=dockerfile: | ||
|
||
FROM ruby:2.7-alpine as app | ||
|
||
LABEL maintainer="Peter Hamilton <[email protected]>" \ | ||
description="ROM-LDAP with Rails" | ||
|
||
RUN apk add --no-cache --no-progress \ | ||
build-base \ | ||
openldap-clients \ | ||
sqlite-dev \ | ||
tzdata | ||
|
||
WORKDIR /usr/app | ||
|
||
VOLUME /usr/app | ||
|
||
EXPOSE 3000 | ||
|
||
COPY docker-entrypoint.sh / | ||
|
||
RUN chmod +x /docker-entrypoint.sh | ||
|
||
ENTRYPOINT ["/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,32 @@ | ||
--- | ||
version: '2.4' | ||
|
||
|
||
# https://docs.docker.com/compose/networking/#use-a-pre-existing-network | ||
# $ docker network ls | ||
networks: | ||
default: | ||
external: | ||
name: docker_rom-ldap-network | ||
|
||
|
||
services: | ||
rom-ldap-rails: | ||
container_name: rom_ldap_rails | ||
build: | ||
context: . | ||
volumes: | ||
- .:/usr/app | ||
- ./tmp/bundler:/usr/local/bundle | ||
ports: | ||
- 3002:3000 | ||
environment: | ||
- TZ | ||
- LOCALE | ||
- LDAPURI=ldap://cn=admin,dc=rom,dc=ldap:topsecret@openldap | ||
- RAILS_ENV=development | ||
command: rails server | ||
tty: true | ||
stdin_open: true | ||
networks: | ||
- default |
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,15 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
echo "Ruby version:" | ||
ruby --version | ||
|
||
echo "Installing ruby gems:" | ||
gem install bundler --no-document | ||
bundle check || bundle install | ||
|
||
echo "Create and migrate database:" | ||
bundle exec rake db:migrate | ||
|
||
exec bundle exec "$@" |