forked from WikiEducationFoundation/WikiEduDashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (31 loc) · 1.09 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Dockerfile
#
# Build and Run:
# - docker build -t wiki-edu-dashboard .
# - docker run -p 3000:3000 -it wiki-edu-dashboard
FROM ruby:3.1.2
WORKDIR /usr/src/app
# Setup repos
RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - &&\
echo "deb https://deb.nodesource.com/node_12.x buster main" | tee /etc/apt/sources.list.d/nodesource.list
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - &&\
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
# Install deps
RUN apt-get update
RUN apt-get install -y nodejs r-base gnupg yarn pandoc redis-server mariadb-server libmariadbclient-dev
# Install gems
RUN bundle config --global frozen 1
COPY Gemfile Gemfile.lock ./
RUN bundle install
# App setup and configurations
COPY . .
COPY config/application.example.yml ./config/application.yml
COPY config/database.example.yml ./config/database.yml
COPY entrypoint.sh ./entrypoint.sh
COPY db_init.sh ./db_init.sh
RUN yarn
# Setup and initialize DBs
RUN ./db_init.sh
EXPOSE 3000
# Setup and run
CMD './entrypoint.sh'