File tree Expand file tree Collapse file tree 2 files changed +50
-2
lines changed Expand file tree Collapse file tree 2 files changed +50
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+
3
+ name : Deploy
4
+ on :
5
+ workflow_dispatch : {}
6
+
7
+ jobs :
8
+ prod :
9
+ name : Production
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - uses : actions/checkout@v3
13
+
14
+ - name : Build the Docker image
15
+ run : docker build -t docs-rs-web -f dockerfiles/Dockerfile --target web-server .
16
+
17
+ - name : Upload the Docker image to ECR
18
+ uses : rust-lang/simpleinfra/github-actions/upload-docker-image@master
19
+ with :
20
+ image : docs-rs-web
21
+ repository : docs-rs-web
22
+ region : us-west-1
23
+ aws_access_key_id : " ${{ secrets.aws_access_key_id }}"
24
+ aws_secret_access_key : " ${{ secrets.aws_secret_access_key }}"
25
+ redeploy_ecs_cluster : rust-ecs-prod
26
+ redeploy_ecs_service : docs-rs-web
Original file line number Diff line number Diff line change 9
9
# Build stage #
10
10
# ################
11
11
12
- FROM ubuntu:bionic AS build
12
+ FROM ubuntu:22.04 AS build
13
13
14
14
# Install packaged dependencies
15
15
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
@@ -53,11 +53,33 @@ COPY vendor vendor/
53
53
54
54
RUN cargo build --release
55
55
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" , "0.0.0.0:80" ]
77
+
56
78
# #################
57
79
# Output stage #
58
80
# #################
59
81
60
- FROM ubuntu:bionic AS output
82
+ FROM ubuntu:22.04 AS output
61
83
62
84
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
63
85
git \
You can’t perform that action at this time.
0 commit comments