Skip to content

Instantly share code, notes, and snippets.

@sunny-b
Last active June 27, 2018 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunny-b/04e0fb63854798961952810a1e121516 to your computer and use it in GitHub Desktop.
Save sunny-b/04e0fb63854798961952810a1e121516 to your computer and use it in GitHub Desktop.
Example files to configure Docker, Nginx, and Passenger on a DigitalOcean Droplet.
server {
# Establish port and server name
listen 80;
server_name <server name>;
# Point Nginx to your app's static "public" directory
root /home/app/<app name>/public;
# Turn on Passenger
passenger_enabled on;
passenger_user app;
# Specify which ruby version you're using
passenger_ruby /usr/bin/ruby2.3;
}
require_relative "app"
run Sinatra::Application
# Specify Docker Compose version to use (3 is most current)
version: "3"
services:
<app name>:
build: .
ports:
- "80:80"
FROM phusion/passenger-full:0.9.33
ENV HOME /root
CMD ["/sbin/my_init"]
RUN rm -f /etc/service/nginx/down
RUN rm /etc/nginx/sites-enabled/default
ADD app.conf /etc/nginx/sites-enabled/app.conf
WORKDIR /home/app/personalSite
COPY --chown=app:app . .
RUN bundle install --without development test
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment