-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (24 loc) · 939 Bytes
/
Dockerfile
File metadata and controls
35 lines (24 loc) · 939 Bytes
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
FROM ubuntu:jammy AS builder
# Install dependencies
RUN apt-get update && apt-get install -y curl libpq5 libpq-dev build-essential
RUN apt-get update && apt-get install -y software-properties-common python3 pkg-config python-dev-is-python3
# Install rust
RUN curl https://sh.rustup.rs/ -sSf | \
sh -s -- -y --default-toolchain nightly
ENV PATH="/root/.cargo/bin:${PATH}"
ADD . ./
RUN cargo build --release
FROM ubuntu:jammy
# Install dependencies
RUN apt-get update && apt-get install -y libpq5 libpq-dev
RUN apt-get update && apt-get install -y sudo
RUN apt-get update && apt-get install -y software-properties-common python3 pkg-config
# Setup sudo
RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo
# Install binary
COPY --from=builder \
/target/release/tool-app \
/usr/local/bin/
ENV PORT 8080
WORKDIR /root
CMD ROCKET_PORT=$PORT /usr/local/bin/tool-app