forked from elovation/elovation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-web
63 lines (45 loc) · 1.52 KB
/
Dockerfile-web
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
53
54
55
56
57
58
59
60
61
62
FROM ruby:2.4.0
RUN apt-get update \
&& apt-get -y install curl \
&& curl -sL https://deb.nodesource.com/setup_8.x | bash
RUN apt-get install -y --no-install-recommends \
postgresql-client \
&& apt-get install -y build-essential patch libpq-dev ruby-dev nodejs zlib1g-dev liblzma-dev \
&& rm -rf /var/lib/apt/lists/*
# Add 'web' user which will run the application
RUN adduser web --home /home/web --shell /bin/bash --disabled-password --gecos ""
## Create user and group
#RUN groupadd --gid 9999 web && \
# useradd --uid 9999 --gid web web && \
# chown -R web:web /var/elovation
RUN gem update --system
RUN gem install bundler foreman
#RUN mkdir /var/log/elovation
RUN mkdir /var/elovation
RUN mkdir /var/elovation/public
RUN mkdir /var/elovation/public/assets
COPY Gemfile /var/elovation/
COPY Gemfile.lock /var/elovation/
RUN chown -R web:web /var/elovation &&\
mkdir -p /var/bundle &&\
chown -R web:web /var/bundle &&\
chown -R web:web /usr/local/bundle
# Add application source
WORKDIR /var/elovation
ADD . /var/elovation
ADD config/database.yml.docker /var/elovation/config/database.yml
RUN chown -R web:web /var/elovation/*
RUN ls -lsat /var/elovation
RUN ls -lsat /var/elovation/public
COPY ./web-entrypoint.sh /
RUN ["chmod", "+x", "/web-entrypoint.sh"]
RUN ls -lsat /web-entrypoint.sh
RUN npm install yarn -g
USER web
ENV RAILS_ENV production
ENV RAILS_LOG_TO_STDOUT yes
ENV RAILS_SERVE_STATIC_FILES yes
RUN bundle env
EXPOSE 5000
ENTRYPOINT ["/web-entrypoint.sh"]
CMD ["foreman", "start"]