Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker config #10

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
target/
Dockerfile
piotrMocz marked this conversation as resolved.
Show resolved Hide resolved
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