-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:indentlabs/notebook
- Loading branch information
Showing
7 changed files
with
96 additions
and
55 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Don't include any of these files in the Dockerfile build context. | ||
# This will improve build performance and reduce the final image size. | ||
# See: https://docs.docker.com/engine/reference/builder/#dockerignore-file | ||
.git/ | ||
.github/ | ||
.coveralls.yml | ||
.dockerignore | ||
.editorconfig | ||
.gitignore | ||
.travis.yml | ||
.rubocop.yml | ||
CHANGELOG.md | ||
docker-compose.yml | ||
log/ | ||
test/ |
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
2.6.6 | ||
|
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 |
---|---|---|
@@ -1,8 +1,32 @@ | ||
# HEADS UP! | ||
# This Dockerfile is for DEVELOPMENT use only; | ||
# it's in no way optimized for production. | ||
|
||
# The image to build from. | ||
FROM ruby:2.6.3 | ||
RUN apt-get update -qq && \ | ||
|
||
# Properties/labels for the image. | ||
LABEL maintainer="Notebook.ai Contributors" | ||
|
||
# Copy the current folder into the notebookai user's home directory. | ||
COPY . /home/notebookai | ||
|
||
# Set the notebookai user's home directory as the working directory. | ||
WORKDIR /home/notebookai | ||
|
||
# Prep the image for runtime, this should all be done in one command | ||
# to minimize image layers. | ||
# See: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#minimize-the-number-of-layers | ||
RUN groupadd --system --gid 1000 notebookai && \ | ||
useradd --system --home-dir /home/notebookai --gid notebookai --uid 1000 --shell /bin/bash notebookai && \ | ||
apt-get update -qq && \ | ||
apt-get install -y build-essential libpq-dev nodejs imagemagick libmagickwand-dev && \ | ||
mkdir /notebook-ai | ||
COPY . /notebook-ai | ||
WORKDIR /notebook-ai | ||
RUN bundle install | ||
RUN rails db:setup | ||
rm --recursive --force /var/lib/apt/lists/* && \ | ||
bundle install && \ | ||
rails db:setup | ||
|
||
# This image should expose the port 3000. | ||
# This does not actually expose the port, you'll have to expose it yourself by | ||
# using `-p 3000:3000/tcp` in Docker's CLI or `- "3000:3000"` in the in docker-compose.yml service's ports[]. | ||
# https://docs.docker.com/engine/reference/builder/#expose | ||
EXPOSE 3000/tcp |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
version: '2' | ||
version: "3.8" | ||
services: | ||
web: | ||
build: . | ||
command: sh -c "rake db:migrate && rm -f tmp/pids/server.pid && exec bundle exec rails server -b '0.0.0.0'" | ||
volumes: | ||
- .:/notebook-ai | ||
ports: | ||
- "3000:3000" | ||
notebookai: | ||
build: . | ||
ports: | ||
- "3000:3000/tcp" | ||
command: sh -c "rake db:migrate && rm -f tmp/pids/server.pid && exec bundle exec rails server -b 0.0.0.0" | ||
volumes: | ||
- "./:/notebook-ai" |
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