Last active
June 27, 2018 01:56
-
-
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.
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
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; | |
} |
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
require_relative "app" | |
run Sinatra::Application |
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
# Specify Docker Compose version to use (3 is most current) | |
version: "3" | |
services: | |
<app name>: | |
build: . | |
ports: | |
- "80:80" |
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
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