Skip to content

Commit b6f97e8

Browse files
yhirano55fxn
authored andcommitted
Add Dockerfile, docker-compose.yml
1 parent eb201b7 commit b6f97e8

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

.dockerignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.bundle
2+
.circleci
3+
.git
4+
vendor/bundle
5+
log/*
6+
!/log/.keep
7+
tmp/*
8+
!/tmp/.keep

Dockerfile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM ruby:2.4
2+
ENV LANG=C.UTF-8
3+
RUN apt-get update -qq && \
4+
apt-get install -y --no-install-recommends \
5+
postgresql-client \
6+
nodejs \
7+
cmake \
8+
pkg-config \
9+
curl \
10+
libsodium-dev && \
11+
gem update --system && \
12+
gem install bundler
13+
WORKDIR /rails-contributors
14+
COPY Gemfile* ./
15+
RUN bundle install -j3
16+
COPY . /rails-contributors

docker-compose.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: '3'
2+
3+
services:
4+
app:
5+
image: rails-contributors
6+
build: .
7+
command: rails s -p 3000 -b 0.0.0.0
8+
environment:
9+
DATABASE_URL: postgres://postgres:@db:5432
10+
ports:
11+
- '3000:3000'
12+
depends_on:
13+
- db
14+
tty: true
15+
stdin_open: true
16+
volumes:
17+
- .:/rails-contributors
18+
db:
19+
image: postgres
20+
volumes:
21+
- postgres:/var/lib/postgresql/data
22+
ports:
23+
- '5432:5432'
24+
25+
volumes:
26+
postgres:

0 commit comments

Comments
 (0)