forked from t3-innovation-network/desm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (37 loc) · 1.58 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (37 loc) · 1.58 KB
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
FROM ruby:3.3.7
RUN apt-get update -qq \
&& apt-get install -y curl \
&& curl -sL https://deb.nodesource.com/setup_22.x | bash - \
&& 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 install -y cowsay \
&& apt-get update -qq \
&& apt-get install -y nodejs yarn postgresql-client \
&& rm -rf /var/lib/apt/lists/* \
&& npm rebuild node-sass
# Specify everything will happen within the /app folder inside the container
RUN mkdir /app
WORKDIR /app
# Copy Gemfile from our current application to the /app container
COPY Gemfile Gemfile.lock package.json ./
ENV NODE_ENV=production
ENV RAILS_ENV=production
ENV ADMIN_ROLE_NAME="Super Admin"
# Install all the backend dependencies
RUN bundle install
# Install all the frontend dependencies
RUN yarn install
# Copy all the files from our current application to the /app
COPY . .
ARG APP_DOMAIN
# generate translations
RUN PRIVATE_KEY=0123456789abcdef SECRET_KEY_BASE=0123456789abcdef0123456789abcdef RAILS_MASTER_KEY=0123456789abcdef0123456789abcdef bundle exec i18n export
# generate JS & CSS
RUN PRIVATE_KEY=0123456789abcdef SECRET_KEY_BASE=0123456789abcdef0123456789abcdef RAILS_MASTER_KEY=0123456789abcdef0123456789abcdef bundle exec rails assets:precompile
# Add a script to be executed on every container start
COPY init.sh /usr/bin/
RUN chmod +x /usr/bin/init.sh
ENTRYPOINT ["init.sh"]
# Expose the port
EXPOSE 3030
CMD [ "bundle", "exec", "bin/rails", "server", "-b", "0.0.0.0", "-p", "3030" ]