Skip to content

Commit 56229fa

Browse files
committed
bump dockerfiles to ubuntu 22.04 and add web-server container
1 parent 7c6715a commit 56229fa

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

dockerfiles/Dockerfile

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# Build stage #
1010
#################
1111

12-
FROM ubuntu:bionic AS build
12+
FROM ubuntu:22.04 AS build
1313

1414
# Install packaged dependencies
1515
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
@@ -53,11 +53,33 @@ COPY vendor vendor/
5353

5454
RUN cargo build --release
5555

56+
######################
57+
# Web server stage #
58+
######################
59+
60+
FROM ubuntu:22.04 AS web-server
61+
62+
RUN apt-get update \
63+
&& DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \
64+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
65+
ca-certificates \
66+
tini \
67+
&& rm -rf /var/lib/apt/lists/*
68+
69+
COPY --from=build /build/target/release/cratesfyi /usr/local/bin
70+
COPY static /srv/docsrs/static
71+
COPY templates /srv/docsrs/templates
72+
COPY vendor /srv/docsrs/vendor
73+
74+
WORKDIR /srv/docsrs
75+
# Tini is a small init binary to properly handle signals
76+
CMD ["/usr/bin/tini", "/usr/local/bin/cratesfyi", "start-web-server"]
77+
5678
##################
5779
# Output stage #
5880
##################
5981

60-
FROM ubuntu:bionic AS output
82+
FROM ubuntu:22.04 AS output
6183

6284
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
6385
git \

0 commit comments

Comments
 (0)