-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.example
60 lines (49 loc) · 2.11 KB
/
Dockerfile.example
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
# See: https://github.com/phusion/passenger-docker
# Latest image versions: https://github.com/phusion/passenger-docker/blob/master/CHANGELOG.md
FROM phusion/passenger-ruby26:1.0.10
ENV HOME /root
# Use baseimage-docker's init process.
CMD ["/sbin/my_init"]
# prevent gpg from using IPv6 to connect to keyservers
RUN mkdir -p ~/.gnupg
RUN echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf
# Yarn package
RUN curl -sS https://raw.githubusercontent.com/yarnpkg/releases/gh-pages/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
# Postgres
RUN curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get update -qq && apt-get dist-upgrade --yes && \
apt-get install --yes pkg-config apt-utils build-essential cmake automake \
&& apt-get upgrade --fix-missing --yes --allow-remove-essential \
-o Dpkg::Options::="--force-confold"
RUN apt-get install --yes tzdata udev locales curl git gnupg ca-certificates \
libpq-dev nodejs wget libxrender1 libxext6 libsodium23 libsodium-dev yarn \
gcc make zlib1g-dev sqlite3 libgmp-dev libc6-dev gcc-multilib g++-multilib \
&& apt-get clean && apt-get autoremove --yes \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Use en_CA.utf8 as our locale
RUN locale-gen en_CA.utf8
ENV LANG en_CA.utf8
ENV LANGUAGE en_CA:en
ENV LC_ALL en_CA.utf8
# Container uses 999 for docker user
RUN /usr/sbin/usermod -u 999 app
#ADD rails-env.conf /etc/nginx/main.d/rails-env.conf
#RUN chmod 644 /etc/nginx/main.d/rails-env.conf
ENV APP_HOME /home/app/workshops
ADD . $APP_HOME
WORKDIR $APP_HOME
RUN rm docker-compose.yml
RUN rm Dockerfile
RUN touch config/app.yml
RUN echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf
RUN chown app -R ./
EXPOSE 80 443
ADD entrypoint.sh /sbin/
RUN rm entrypoint.sh
RUN chmod 755 /sbin/entrypoint.sh
RUN mkdir -p /etc/my_init.d
RUN ln -s /sbin/entrypoint.sh /etc/my_init.d/entrypoint.sh
RUN echo 'export PATH=$PATH:./bin:/usr/local/rvm/rubies/ruby-2.6.6/bin' >> /root/.bashrc
RUN echo 'alias rspec="bundle exec rspec"' >> /root/.bashrc
ENTRYPOINT ["/sbin/entrypoint.sh"]