Skip to content

Commit

Permalink
initialisation des fichiers de déployement test ok
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGANGLOFF committed Apr 8, 2024
1 parent 18fb90a commit c3ab72c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM rust:latest@sha256:84d4e88a86481073bf876770768632d8c7783fc58f14fbd67b387f75

# Copiez tous les membres du workspace ainsi que le fichier de workspace.
# Pre-building de eat pour le caching des dépendances
WORKDIR /usr/src/eat
WORKDIR /usr/src/drink
COPY ./Cargo.toml ./Cargo.toml
COPY ./common ./common
COPY ./services ./services
Expand All @@ -18,7 +18,7 @@ FROM debian:bookworm@sha256:c2cedd7f80a4dd0f9f80d3699bd433ccf3de33ab63bfa2d4c4ba
RUN apt-get update && apt-get install -y openssl && apt-get install -y ca-certificates && \
update-ca-certificates && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/src/eat/target/release/eat /usr/local/bin/eat
EXPOSE 8002
COPY --from=builder /usr/src/drink/target/release/drink /usr/local/bin/drink
EXPOSE 8003

CMD ["eat"]
CMD ["drink"]
16 changes: 8 additions & 8 deletions deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: eat
namespace: eat
name: drink
namespace: drink
labels:
name: eat
name: drink
spec:
replicas: 2
selector:
matchLabels:
app: eat
app: drink
template:
metadata:
labels:
app: eat
app: drink
spec:
containers:
- name: eat
image: d3spina/t-web-800:eat-latest
- name: drink
image: d3spina/t-web-800:drink-latest
imagePullPolicy: Always
env:
- name: ROCKET_ADDRESS
value: "0.0.0.0"
- name: ROCKET_PORT
value: "8002"
value: "8003"
ports:
- containerPort: 8002
resources:
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ services:
build:
context: .
dockerfile: Dockerfile
image: eat
image: drink
ports:
- "8002:8002"
- "8003:8003"
environment:
ROCKET_ADDRESS: "0.0.0.0"
ROCKET_PORT: "8002"
ROCKET_PORT: "8003"
8 changes: 4 additions & 4 deletions service.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: eat-service
namespace: eat
name: drink-service
namespace: drink
spec:
selector:
app: eat
app: drink
ports:
- protocol: TCP
port: 80
targetPort: 8002
targetPort: 8003
type: LoadBalancer

0 comments on commit c3ab72c

Please sign in to comment.