-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
54 lines (47 loc) · 1004 Bytes
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Load the Docker image.
FROM ruby:3.0.3-alpine3.13
# Define environment variables.
ENV LANG C.UTF-8
ENV PS1 '▶ '
ENV RAILS_ROOT /rails-7-hotwire
ENV BUNDLE_PATH /usr/local/bundle
# Install Packages.
RUN apk update && apk upgrade && apk add --update --no-cache \
build-base \
curl-dev \
linux-headers \
libxml2-dev \
libxslt-dev \
postgresql-dev \
ruby-dev \
yaml-dev \
graphviz \
zlib-dev \
bash \
git \
openssh \
postgresql \
ruby-json \
tzdata \
vim \
nodejs \
yaml \
curl \
imagemagick \
yarn --repository="http://dl-cdn.alpinelinux.org/alpine/edge/community" \
libc6-compat && ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2
# Set up a work directory.
RUN mkdir $RAILS_ROOT
WORKDIR $RAILS_ROOT
# Add Puma SSL certificate files.
COPY ./keys/ /home/root/.ssh/
# Install Gems
ADD Gemfile .
ADD Gemfile.lock .
RUN bundle install -j4
# Install Yarns
COPY package.json .
COPY yarn.lock .
RUN yarn
# Copy the source code.
ADD . $RAILS_ROOT