forked from maisieccino/omni-dash
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (50 loc) · 1.92 KB
/
Dockerfile
File metadata and controls
68 lines (50 loc) · 1.92 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
# NAME: shecancode/hatch-site
# Use the barebones version of Ruby 2.4.1.
FROM ruby:2.4.2-slim
# Setting environment variables using sane defaults
# These can be overwritten at run time
ENV RAILS_DB_HOSTNAME localhost
ENV RAILS_DB_PORT 5432
ENV RAILS_DB_USER postgres
ENV RAILS_DB_PASS changeme
ENV RAILS_ADMIN_USER_EMAIL admin@example.com
ENV RAILS_ADMIN_USER_FIRSTNAME Admin
ENV RAILS_ADMIN_USER_LASTNAME User
ENV RAILS_ADMIN_USER_PASS changeme
ENV WORK_DIR /hatch_web
# Install dependencies:
ADD https://dl.yarnpkg.com/debian/pubkey.gpg /tmp/yarn-pubkey.gpg
RUN apt-key add /tmp/yarn-pubkey.gpg && rm /tmp/yarn-pubkey.gpg
RUN echo 'deb http://dl.yarnpkg.com/debian/ stable main' > /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -qq -y --no-install-recommends \
build-essential libpq-dev curl imagemagick
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get update && apt-get install -qq -y --no-install-recommends nodejs yarn
RUN npm install --global yarn
# This sets the context of where commands will be ran
RUN mkdir -p $WORK_DIR
WORKDIR $WORK_DIR
# Use COPY for copying local files
# relative paths are:
# first arg: relative to the path passed to `docker build`
# second arg: relative to WORKDIR
COPY ./Gemfile $WORK_DIR/Gemfile
COPY ./Gemfile.lock $WORK_DIR/Gemfile.lock
RUN bundle install
# Copy the application code
COPY . $WORK_DIR/
COPY ./.env .env
RUN yarn --pure-lockfile
# TODO: Might need fixing
RUN cd $WORK_DIR/client && yarn run build:production
RUN ls
CMD ["sh", "run-prod.sh"]
# Use VOLUME to specify directories where files are changed at runtime
# if the app is down, these should still exist
# eg: /tmp, /log, /uploads ...
# commenting this because I don't know yet what these are
#VOLUME ["/var/upload","/var/logs/hatch-site"]
## Build (and tag) this image:
#> docker build -t shecancode/hatch-site .
## Publish to registry (necessary to deploy)
#> docker push shecancode/hatch-site