-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (44 loc) · 1.48 KB
/
Copy pathDockerfile
File metadata and controls
52 lines (44 loc) · 1.48 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM ubuntu:24.04 AS build
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cmake \
curl \
git \
pkg-config \
libmongoc-dev \
libpq-dev \
libpoco-dev \
libpqxx-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY . .
RUN rm -rf build \
&& cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
&& cmake --build build -j"$(nproc)"
FROM ubuntu:24.04
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
libmongoc-1.0-0 \
libbson-1.0-0 \
libpq5 \
libpoco-dev \
libpqxx-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /app/build/car_rental_api /usr/local/bin/car_rental_api
COPY openapi.yaml /app/openapi.yaml
COPY schema.sql /app/schema.sql
COPY data.sql /app/data.sql
COPY queries.sql /app/queries.sql
COPY optimization.md /app/optimization.md
COPY performance_design.md /app/performance_design.md
COPY schema_design.md /app/schema_design.md
COPY data.js /app/data.js
COPY queries.js /app/queries.js
COPY validation.js /app/validation.js
EXPOSE 8080
HEALTHCHECK --interval=10s --timeout=3s --retries=5 CMD curl -fsS http://127.0.0.1:8080/health || exit 1
ENTRYPOINT ["/usr/local/bin/car_rental_api"]
CMD ["--host", "0.0.0.0", "--port", "8080", "--data-backend", "mongo", "--mongo-url", "mongodb://mongo:27017/?replicaSet=rs0", "--mongo-db", "car_rental", "--jwt-secret", "docker-dev-secret", "--manager-password", "Manager123!"]