-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
36 lines (26 loc) · 1.12 KB
/
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
35
36
# See https://github.com/phusion/baseimage-docker/releases for a list of releases.
FROM phusion/baseimage:0.11
LABEL maintainer="[email protected]"
# Prepare to install/update packages
RUN apt-get update
# Update packages
# RUN apt-get upgrade -y -o Dpkg::Options::="--force-confnew"
WORKDIR /tmp
# Pick a Crystal version and install the amd64 .deb: https://github.com/crystal-lang/crystal/releases
RUN curl -sL https://github.com/crystal-lang/crystal/releases/download/0.30.1/crystal_0.30.1-1_amd64.deb > crystal.deb
RUN apt-get install -y ./crystal.deb
RUN apt-get install -y libyaml-dev
# RUN apt-get autoremove -y
# Build guardian
RUN git clone https://github.com/f/guardian.git && cd guardian && crystal build src/guardian.cr --release && cp guardian /usr/bin/
# Add app user
RUN useradd -m -k /etc/skel app
WORKDIR /home/app/myapp
# Startup scripts
RUN mkdir -p /etc/my_init.d
COPY docker/startup/chown.sh /etc/my_init.d/
# Post-build clean up
RUN apt-get clean && rm -rf /tmp/* /var/tmp/*
RUN rm -rf /var/lib/apt/lists/*
# Run this to start all services (if no command was provided to `docker run`)
CMD ["/sbin/my_init"]