2024-01-02 14:00:21 +01:00
FROM ruby:3.2.2
MAINTAINER contact@sleede.com
2016-03-23 18:39:41 +01:00
2024-01-02 14:00:21 +01:00
# First we need to be able to fetch from https repositories
RUN apt-get update && \
apt-get install -y apt-transport-https \
2024-02-02 17:28:55 +01:00
postgresql-client \
2024-01-02 14:00:21 +01:00
ca-certificates apt-utils supervisor locales
RUN locale-gen C.UTF-8
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -\
&& apt-get update -qq && apt-get install -qq --no-install-recommends \
nodejs \
&& apt-get upgrade -qq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*\
&& npm install -g yarn@1
2019-09-12 01:38:20 +02:00
2022-05-12 10:33:41 +02:00
# Fix bug: LoadError: Could not open library '/usr/local/bundle/gems/sassc-2.1.0-x86_64-linux/lib/sassc/libsass.so': Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /usr/local/bundle/gems/sassc-2.1.0-x86_64-linux/lib/sassc/libsass.so)
# add libsass-dev libsass libc6-compat and env below
ENV LD_LIBRARY_PATH = /lib64
2020-05-18 11:08:06 +02:00
RUN gem install bundler
2019-09-12 01:38:20 +02:00
# Throw error if Gemfile has been modified since Gemfile.lock
2016-03-23 18:39:41 +01:00
RUN bundle config --global frozen 1
2019-09-12 01:38:20 +02:00
# Install gems in a cache efficient way
2016-03-23 18:39:41 +01:00
WORKDIR /tmp
2024-01-02 14:00:21 +01:00
COPY Gemfile /tmp/
COPY Gemfile.lock /tmp/
RUN bundle install --binstubs --without development test doc
2022-06-06 17:23:02 +02:00
2019-09-12 01:38:20 +02:00
# Install Javascript packages
WORKDIR /usr/src/app
COPY package.json /usr/src/app/package.json
COPY yarn.lock /usr/src/app/yarn.lock
2020-10-06 09:08:56 +02:00
RUN yarn install
2018-11-22 17:09:14 +01:00
2024-01-02 14:00:21 +01:00
# Web app
RUN mkdir -p /usr/src/app && \
mkdir -p /usr/src/app/config && \
mkdir -p /usr/src/app/invoices && \
mkdir -p /usr/src/app/payment_schedules && \
mkdir -p /usr/src/app/exports && \
mkdir -p /usr/src/app/imports && \
mkdir -p /usr/src/app/log && \
mkdir -p /usr/src/app/public/uploads && \
mkdir -p /usr/src/app/public/packs && \
mkdir -p /usr/src/app/accounting && \
mkdir -p /usr/src/app/supporting_document_files && \
mkdir -p /usr/src/app/tmp/sockets && \
mkdir -p /usr/src/app/tmp/pids
2016-03-23 18:39:41 +01:00
COPY docker/database.yml /usr/src/app/config/database.yml
COPY . /usr/src/app
2022-06-07 15:12:07 +02:00
# Volumes (the folders are created by setup.sh)
2022-06-08 10:14:47 +02:00
VOLUME /usr/src/app/invoices \
/usr/src/app/payment_schedules \
/usr/src/app/exports \
/usr/src/app/imports \
/usr/src/app/public \
/usr/src/app/public/uploads \
/usr/src/app/public/packs \
/usr/src/app/accounting \
2023-02-13 17:31:57 +01:00
/usr/src/app/supporting_document_files \
2022-06-08 10:14:47 +02:00
/var/log/supervisor
2016-03-23 18:39:41 +01:00
2019-09-12 01:38:20 +02:00
# Expose port 3000 to the Docker host, so we can access it from the outside
2016-09-06 12:19:47 +02:00
EXPOSE 3000
2016-03-23 18:39:41 +01:00
2019-09-12 01:38:20 +02:00
# The main command to run when the container starts. Also tell the Rails server
# to bind to all interfaces by default.
2022-06-08 09:33:09 +02:00
COPY docker/supervisor.conf /etc/supervisor/conf.d/fabmanager.conf
CMD [ "/usr/bin/supervisord" , "-c" , "/etc/supervisor/conf.d/fabmanager.conf" ]