-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
32 lines (26 loc) · 1.01 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
FROM debian:stable-slim
ARG env=debug
RUN mkdir -p /app/config \
&& mkdir -p /app/migrations \
&& apt-get update \
&& apt-get install -y wget gnupg2 ca-certificates \
&& wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add - \
&& sh -c echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" >> /etc/apt/sources.list.d/pgdg.list \
&& wget -q https://s3.eu-central-1.amazonaws.com/dumpster.stq/diesel -O /usr/local/bin/diesel \
&& chmod +x /usr/local/bin/diesel \
&& apt-get update \
&& apt-get install -y libpq5 libmariadbclient18 \
&& apt-get purge -y wget \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/ \
&& adduser --disabled-password --gecos "" --home /app --no-create-home -u 5000 app \
&& chown -R app: /app
COPY target/$env/users /app
COPY config /app/config
COPY migrations /app/migrations
COPY Cargo.toml /app/Cargo.toml
USER app
WORKDIR /app
EXPOSE 8000
ENTRYPOINT ["sh", "-c", "diesel migration run && /app/users"]