-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDockerfile
39 lines (28 loc) · 1.08 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
FROM ruby:3.2.2
# Install system dependencies required by the app
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
# Install yarn
RUN apt-get install -y curl && \
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 && \
apt-get update -qq && \
apt-get install -y yarn
# Set the working directory
WORKDIR /app
# Copy the Gemfile and Gemfile.lock into the container
COPY Gemfile* ./
# Install the required gems
RUN bundle install
# Copy the rest of the app code into the container
COPY . .
# Install Node.js version 14.x
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs
# Install JavaScript dependencies with yarn
RUN yarn install --check-files
# Precompile assets with esbuild and TailwindCSS
RUN bundle exec rake assets:precompile
# Precompile assets with esbuild and TailwindCSS
RUN yarn build
# Change permissions of start.sh script to make it executable
RUN chmod +x ./bin/docker-entrypoint