Skip to content

Commit

Permalink
Docker config (#10)
Browse files Browse the repository at this point in the history
* Docker config

* Update .dockerignore
  • Loading branch information
piotrMocz authored Jan 26, 2024
1 parent e2b15f9 commit a220ee0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
target/
Dockerfile
20 changes: 4 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,21 @@
FROM rust:buster as builder
FROM rust:1.74-buster as builder
WORKDIR /app

COPY . .
ADD . .

RUN cargo build --release --verbose

# =============

FROM phusion/baseimage:focal-1.2.0
LABEL maintainer="[email protected]"
FROM ubuntu:22.04

RUN useradd -m -u 1000 -U -s /bin/sh -d /app docker

WORKDIR /app

RUN apt-get update && apt-get install tini

COPY --from=builder /app/target/release/subway /usr/local/bin
COPY ./config.yml /app/config.yml

# checks
RUN ldd /usr/local/bin/subway && \
/usr/local/bin/subway --version

# Shrinking
RUN rm -rf /usr/lib/python* && \
rm -rf /usr/sbin /usr/share/man

USER docker
EXPOSE 9944

ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/subway"]
ENTRYPOINT ["/usr/local/bin/subway"]
2 changes: 1 addition & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extensions:
# WARNING: Use with caution, as this xff header can be forged.
use_xff: true # default is false
prometheus:
port: 9615
port: 9616
label: "dev"

middlewares:
Expand Down

0 comments on commit a220ee0

Please sign in to comment.