Jonathan Rosenbaum
3 years ago
12 changed files with 195 additions and 25 deletions
@ -0,0 +1,43 @@ |
|||||
|
############ |
||||
|
# BikeBike # |
||||
|
############ |
||||
|
|
||||
|
|
||||
|
FROM ruby:2.5 |
||||
|
MAINTAINER Jonathan Rosenbaum <bike@bikelover.org> |
||||
|
|
||||
|
##RUN git clone https://github.com/fspc/BikeBikeBike.git /app/BikeBike |
||||
|
COPY . /app/BikeBike |
||||
|
|
||||
|
RUN apt-get update && apt-get install -y nodejs postgresql-client |
||||
|
|
||||
|
# Note: phantomjs has been deprecated in favor of headless chrome |
||||
|
WORKDIR /app/BikeBike |
||||
|
|
||||
|
# COPY changes/Gemfile . |
||||
|
# Use DATABASE_URL env variable instead, although it takes precedence, regardless |
||||
|
# COPY database.yml ./config/database.yml |
||||
|
RUN bundle install |
||||
|
|
||||
|
RUN mkdir -p public/stylesheets/application -p public/stylesheets/web-fonts && tar xvfz bumbleberry-css.tar.gz -C public/stylesheets/application && tar xvfz bumbleberry-css.tar.gz -C public/stylesheets/web-fonts |
||||
|
|
||||
|
#RUN gem install json -v '1.8.6' |
||||
|
#RUN gem install activesupport -v '4.2.0' |
||||
|
#RUN gem install mini_portile2 -v '2.6.1' |
||||
|
#RUN gem install racc -v '1.6.0' |
||||
|
#RUN gem install actionview -v '4.2.0' |
||||
|
|
||||
|
# Gem::LoadError: You have already activated rake 12.3.3, but your Gemfile requires rake 11.1.2. Prepending `bundle exec` to your command may solve this. |
||||
|
# Do this with docker-compose |
||||
|
# RUN rake db:create |
||||
|
# RUN rake db:migrate |
||||
|
|
||||
|
|
||||
|
# Add a script to be executed every time the container starts. |
||||
|
COPY entrypoint.sh /usr/bin/ |
||||
|
RUN chmod +x /usr/bin/entrypoint.sh |
||||
|
ENTRYPOINT ["entrypoint.sh"] |
||||
|
EXPOSE 3000 |
||||
|
|
||||
|
# Configure the main process to run when running the image |
||||
|
CMD ["rails", "server", "-b", "0.0.0.0"] |
@ -0,0 +1,4 @@ |
|||||
|
//= link_tree ../images
|
||||
|
//= link_directory ../javascripts .js
|
||||
|
//= link_directory ../stylesheets .scss
|
||||
|
//= link_directory ../fonts
|
Binary file not shown.
@ -0,0 +1,12 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
# This assume docker-compose build, which takes a long time and builds the image, has already happened, |
||||
|
# it should on up -d. |
||||
|
# Also, you may need to remove and create the external volumes again for the steps |
||||
|
# below to work correctly. |
||||
|
docker-compose up -d |
||||
|
docker-compose run bikebike rake db:setup |
||||
|
docker-compose run bikebike rake db:migrate |
||||
|
docker-compose run bikebike rake assets:precompile |
||||
|
docker-compose down |
||||
|
docker-compose up -d |
@ -0,0 +1,89 @@ |
|||||
|
# BikeBike |
||||
|
# |
||||
|
# ENV DATABASE_URL string = https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING |
||||
|
# |
||||
|
# docker-compose up -d |
||||
|
# docker-compose run bikebike rake db:setup |
||||
|
# docker-compose run bikebike rake db:migrate |
||||
|
# docker-compose run bikebike rake assets:precompile |
||||
|
# docker-compose down |
||||
|
# docker-compose up |
||||
|
# |
||||
|
# don't do this because new sprockets and manifest.js isn't precompiling to *css, and breaks the container |
||||
|
# -- docker-compose run bikebike rake bumbleberry:update -- |
||||
|
|
||||
|
|
||||
|
version: '3' |
||||
|
|
||||
|
services: |
||||
|
|
||||
|
db: |
||||
|
container_name: bikebikebike-db |
||||
|
image: postgres:9.5 |
||||
|
ports: |
||||
|
- "5432" |
||||
|
restart: always |
||||
|
logging: |
||||
|
driver: "json-file" |
||||
|
options: |
||||
|
max-size: "10m" |
||||
|
max-file: "3" |
||||
|
volumes: |
||||
|
- bikebikebike_db:/var/lib/postgresql/data |
||||
|
environment: |
||||
|
- POSTGRES_PASSWORD=password |
||||
|
- POSTGRES_USER=bike_bike |
||||
|
- POSTGRES_DB=bike_bike |
||||
|
|
||||
|
bikebike: |
||||
|
build: . |
||||
|
image: bikebikebike |
||||
|
container_name: bikebikebike |
||||
|
networks: |
||||
|
letsencrypt: |
||||
|
default: |
||||
|
command: /bin/sh -c "rm -f /app/BikeBike/tmp/pids/server.pid && rails server -e production -b '0.0.0.0'" |
||||
|
# Add environment values that are not in .env (environment:) below in the bike_bike_advanced_environment file |
||||
|
# Empty file ok, too, or just comment out this section |
||||
|
env_file: |
||||
|
- bike_bike_advanced_environment |
||||
|
# Add your own environment values in .env, or use the default ones |
||||
|
environment: |
||||
|
- PORT=3000 |
||||
|
- DATABASE_URL=${DATABASE_URL:-postgresql://bike_bike:password@db/bike_bike?encoding=unicode&pool=5} |
||||
|
- RAILS_ENV=${RAILS_ENV:-production rails assets:precompile.log} |
||||
|
- SMTP_ADDRESS=${SMTP_ADDRESS:-fake-smtp.bikebike.org} |
||||
|
- SMTP_DOMAIN=${SMTP_DOMAIN:-bikebike.org} |
||||
|
- SMTP_PORT=${SMTP_PORT:-587} |
||||
|
- SMTP_USER_NAME=${SMTP_USER_NAME:-info@bikebike.org} |
||||
|
- SMTP_PASSWORD=${SMTP_PASSWORD:-fake} |
||||
|
- DEFAULT_URL=${DEFAULT_URL:-bikebike.org} |
||||
|
volumes: |
||||
|
- bikebikebike:/app/BikeBike |
||||
|
- bikebikebike_bundle:/usr/local/bundle |
||||
|
build: . |
||||
|
expose: |
||||
|
- "3000" |
||||
|
links: |
||||
|
- db |
||||
|
restart: always |
||||
|
logging: |
||||
|
driver: "json-file" |
||||
|
options: |
||||
|
max-size: "10m" |
||||
|
max-file: "3" |
||||
|
|
||||
|
# Create this volumes, docker volume create me |
||||
|
# or comment our external |
||||
|
volumes: |
||||
|
bikebikebike_db: |
||||
|
external: true |
||||
|
bikebikebike: |
||||
|
external: true |
||||
|
bikebikebike_bundle: |
||||
|
external: true |
||||
|
|
||||
|
# Remove this network if you don't use it |
||||
|
networks: |
||||
|
letsencrypt: |
||||
|
external: true |
@ -0,0 +1,8 @@ |
|||||
|
#!/bin/bash |
||||
|
set -e |
||||
|
|
||||
|
# Remove a potentially pre-existing server.pid for Rails. |
||||
|
rm -f /app/BikeBike/tmp/pids/server.pid |
||||
|
|
||||
|
# Then exec the container's main process (what's set as CMD in the Dockerfile). |
||||
|
exec "$@" |
Loading…
Reference in new issue