-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from InsanityRadio/dockerize
Dockerize Nerve
- Loading branch information
Showing
10 changed files
with
439 additions
and
7 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 |
---|---|---|
|
@@ -3,3 +3,4 @@ Gemfile.lock | |
config.yml | ||
export | ||
schema.current.sql | ||
config/root.txt |
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
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
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
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
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,10 @@ | ||
class AddTimes < ActiveRecord::Migration | ||
def change | ||
|
||
execute 'ALTER TABLE albums ALTER COLUMN creation_date SET DEFAULT NOW()' | ||
execute 'ALTER TABLE artists ALTER COLUMN creation_date SET DEFAULT NOW()' | ||
execute 'ALTER TABLE nerve_cache ALTER COLUMN creation_date SET DEFAULT NOW()' | ||
execute 'ALTER TABLE tracks ALTER COLUMN creation_date SET DEFAULT NOW()' | ||
|
||
end | ||
end |
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,84 @@ | ||
version: '3.1' | ||
|
||
services: | ||
mariadb: | ||
restart: always | ||
image: mariadb | ||
environment: | ||
- MYSQL_ROOT_PASSWORD_FILE=/config/root.txt | ||
- MYSQL_DATABASE=nerve | ||
volumes: | ||
- ./config:/config | ||
redis: | ||
image: redis | ||
|
||
http: | ||
restart: always | ||
build: | ||
context: . | ||
dockerfile: docker/Dockerfile.http | ||
args: | ||
- http_proxy | ||
- https_proxy | ||
- RESOLVER=8.8.8.8 | ||
ports: | ||
- "9292:80" | ||
links: | ||
- redis | ||
- mariadb | ||
secrets: | ||
- source: "nerve_root_pw" | ||
target: "nerve_root_pw" | ||
uid: "9999" | ||
gid: "9999" | ||
mode: 0400 | ||
environment: | ||
- http_proxy | ||
- https_proxy | ||
volumes: | ||
- tmp:/tmp | ||
- music:/music | ||
- ./config:/config | ||
worker: | ||
restart: always | ||
build: | ||
context: . | ||
dockerfile: docker/Dockerfile.worker | ||
args: | ||
- http_proxy | ||
- https_proxy | ||
- RESOLVER=8.8.8.8 | ||
links: | ||
- redis | ||
- mariadb | ||
secrets: | ||
- source: "nerve_root_pw" | ||
target: "nerve_root_pw" | ||
uid: "9999" | ||
gid: "9999" | ||
mode: 0400 | ||
environment: | ||
- http_proxy | ||
- https_proxy | ||
volumes: | ||
- tmp:/tmp | ||
- music:/music | ||
- audiowall:/audiowall | ||
- ./config:/config | ||
volume_own: | ||
restart: "no" | ||
image: alpine | ||
command: "chown -R 999:999 /music" | ||
volumes: | ||
- music:/music | ||
- audiowall:/audiowall | ||
secrets: | ||
nerve_root_pw: | ||
file: ./config/root.txt | ||
|
||
volumes: | ||
music: | ||
tmp: | ||
audiowall: | ||
external: | ||
name: audiowall |
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,31 @@ | ||
FROM phusion/passenger-ruby23:latest | ||
MAINTAINER [email protected] | ||
|
||
ARG RESOLVER=8.8.8.8 | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
build-essential git libc6-dev wget | ||
|
||
WORKDIR /tmp | ||
RUN wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.00.27.tar.gz && \ | ||
tar -xzf freetds-1.00.27.tar.gz | ||
WORKDIR /tmp/freetds-1.00.27 | ||
RUN ./configure --prefix=/usr/local --with-tdsver=7.3 && make && make install | ||
|
||
RUN rm -f /etc/service/nginx/down | ||
|
||
WORKDIR /home/app | ||
|
||
COPY ./Gemfile ./ | ||
RUN gem install bundler && bundle install --jobs 20 --retry 5 | ||
|
||
COPY ./docker/nginx.conf /etc/nginx/sites-enabled/default | ||
|
||
RUN ln -s /config/config.yml ./config.yml | ||
|
||
COPY ./ ./ | ||
RUN rm config/root.txt | ||
RUN chown -R app: . | ||
|
||
CMD ["/sbin/my_init"] | ||
|
Oops, something went wrong.