-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathDockerfile
34 lines (29 loc) · 873 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
# syntax=docker/dockerfile:1
FROM ruby:3.3 AS dm2-dev
# Install node.js and yarn
RUN apt-get update -qq && apt-get install -y curl sudo
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
RUN apt-get install -y nodejs
RUN npm install -g yarn
# Install bundler and API
ENV INSTALL_PATH /opt/app
RUN mkdir -p $INSTALL_PATH
WORKDIR $INSTALL_PATH
COPY . $INSTALL_PATH
RUN gem install bundler
RUN bundle install
# Add a script to be executed every time the container starts
COPY entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 443
EXPOSE 3000
EXPOSE 3001
# Install frontend
WORKDIR $INSTALL_PATH/client
RUN yarn install && NODE_OPTIONS="--max_old_space_size=2560" yarn build-craco
WORKDIR $INSTALL_PATH
RUN cp -a $INSTALL_PATH/client/build/. $INSTALL_PATH/public/
RUN yarn deploy
# Run shell
CMD ["/bin/sh"]