-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
71 lines (61 loc) · 1.72 KB
/
Copy pathDockerfile
File metadata and controls
71 lines (61 loc) · 1.72 KB
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
63
64
65
66
67
68
69
70
71
FROM ruby:2.4.4-alpine3.7
MAINTAINER info@makernet.work
# Install runtime apk based dependencies.
RUN apk update && apk upgrade
RUN apk add --update curl \
bash \
bash-completion \
nano \
nodejs \
imagemagick \
supervisor \
tzdata \
libc-dev \
ruby-dev \
zlib-dev \
xz-dev \
postgresql-dev \
libxml2-dev \
libxslt-dev \
libidn-dev
# Install buildtime apk based dependencies.
RUN apk add --update --no-cache --virtual .build-deps alpine-sdk \
build-base \
linux-headers \
git \
patch
# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1
# Run Bundle in a cache efficient way
WORKDIR /tmp
COPY Gemfile /tmp/
COPY Gemfile.lock /tmp/
RUN bundle install --binstubs --without development test doc
# Clean up when done.
RUN apk del .build-deps
RUN rm -rf /tmp/* /var/tmp/*
# Web app
RUN mkdir -p /usr/src/app
RUN mkdir -p /usr/src/app/config
RUN mkdir -p /usr/src/app/invoices
RUN mkdir -p /usr/src/app/exports
RUN mkdir -p /usr/src/app/log
RUN mkdir -p /usr/src/app/public/uploads
RUN mkdir -p /usr/src/app/public/assets
RUN mkdir -p /usr/src/app/tmp/sockets
RUN mkdir -p /usr/src/app/tmp/pids
WORKDIR /usr/src/app
COPY . /usr/src/app
# Volumes
VOLUME /usr/src/app/invoices
VOLUME /usr/src/app/exports
VOLUME /usr/src/app/public
VOLUME /usr/src/app/public/uploads
VOLUME /usr/src/app/public/assets
VOLUME /var/log/supervisor
# Expose port 3000 to the Docker host, so we can access it from the outside.
EXPOSE 3000
# The main command to run when the container starts. Also tell the Rails dev
# server to bind to all interfaces by default.
COPY docker/supervisor.conf /etc/supervisor/conf.d/makernet.conf
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/makernet.conf"]