-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Dockerfile
52 lines (32 loc) · 1.19 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
41
42
43
44
45
46
47
48
49
50
51
52
FROM ruby:2.6.5-slim-stretch
ARG UID=1000
ARG GID=1000
RUN addgroup --system listed --gid $GID && adduser --disabled-password --system listed --gid $GID --uid $UID
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN apt-get update \
&& apt-get install -y git build-essential libmariadb-dev curl imagemagick python \
&& apt-get -y autoclean
RUN mkdir -p /usr/local/nvm
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 14.18.2
ENV NVM_INSTALL_PATH $NVM_DIR/versions/node/v$NODE_VERSION
ENV WEBPACKER_NODE_MODULES_BIN_PATH=value
RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
RUN source $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
ENV NODE_PATH $NVM_INSTALL_PATH/lib/node_modules
ENV PATH $NVM_INSTALL_PATH/bin:$PATH
RUN npm install -g yarn
WORKDIR /listed
RUN chown -R $UID:$GID .
USER listed
COPY --chown=$UID:$GID package.json yarn.lock Gemfile Gemfile.lock /listed/
RUN yarn install --pure-lockfile
RUN gem install bundler && bundle install
COPY --chown=$UID:$GID . /listed
RUN bundle exec rake assets:precompile
EXPOSE 3000
ENTRYPOINT [ "docker/entrypoint.sh" ]
CMD [ "start" ]