-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (28 loc) · 970 Bytes
/
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
# 1: Use ruby base:
FROM crystallang/crystal:0.35.1
ARG UNAME=dev
ARG UID=1000
ARG GID=1000
ARG PWD=/usr/src/app
ARG USER_HOME=/usr/src
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates wget
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" >> /etc/apt/sources.list.d/pgdg.list && \
apt-get update -q --fix-missing && \
apt-get install -y --no-install-recommends \
build-essential \
libpq-dev \
postgresql-client-12 \
libc6-dev \
libevent-dev \
libssl-dev \
libyaml-dev \
zlib1g-dev \
&& apt-get clean
# 2: We'll set the application path as the working directory
WORKDIR $PWD
RUN groupadd -g $GID -o $UNAME
RUN useradd -d ${USER_HOME} -u $UID -g $GID -o -s /bin/bash $UNAME
RUN chown ${UNAME} ${USER_HOME}
USER $UNAME