Implement Dockerfile

This commit is contained in:
swaggboi 2022-02-13 02:01:37 -05:00
parent 1209b749ae
commit fdb2fe3775
3 changed files with 41 additions and 1 deletions

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM ruby:3.1
# Move it
WORKDIR /opt
COPY public/ ./public/
COPY views/ ./views/
COPY Gemfile .
COPY config.ru .
COPY mywillpower.rb .
# Dependencies
RUN apt-get update
RUN apt-get -y upgrade
RUN bundle install
# Environment
EXPOSE 4567
# Send it
CMD ["bundle", "exec", "rackup", "-o", "0.0.0.0", "-p", "4567", "-E", \
"production"]

View File

@ -2,6 +2,22 @@
Source code for http://mywillpower.org Source code for http://mywillpower.org
## Install dependencies ## Local
### Install dependencies
bundle install bundle install
### Run it locally
bundle exec mywillpower.rb
## Docker
### Build
docker build -t mywillpower .
### Run
docker run -p 4567:4567 mywillpower

3
config.ru Normal file
View File

@ -0,0 +1,3 @@
require './mywillpower'
run Sinatra::Application