Skip to content

Commit

Permalink
edit deployment files
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGANGLOFF committed Apr 11, 2024
1 parent d8840a3 commit 1f17ecc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
FROM rust:latest@sha256:84d4e88a86481073bf876770768632d8c7783fc58f14fbd67b387f75f889db23 as builder

# Copiez tous les membres du workspace ainsi que le fichier de workspace.
# Pre-building de enjoy pour le caching des dépendances
WORKDIR /usr/src/enjoy
# Pre-building de eat pour le caching des dépendances
WORKDIR /usr/src/eat
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/enjoy/target/release/enjoy /usr/local/bin/enjoy
EXPOSE 8006
COPY --from=builder /usr/src/eat/target/release/eat /usr/local/bin/eat
EXPOSE 8002

CMD ["enjoy"]
CMD ["eat"]
18 changes: 9 additions & 9 deletions deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: enjoy
namespace: enjoy
name: eat
namespace: eat
labels:
name: enjoy
name: eat
spec:
replicas: 2
selector:
matchLabels:
app: enjoy
app: eat
template:
metadata:
labels:
app: enjoy
app: eat
spec:
containers:
- name: enjoy
image: d3spina/t-web-800:enjoy-latest
- name: eat
image: d3spina/t-web-800:eat-latest
imagePullPolicy: Always
env:
- name: ROCKET_ADDRESS
value: "0.0.0.0"
- name: ROCKET_PORT
value: "8006"
value: "8002"
ports:
- containerPort: 8006
- containerPort: 8002
resources:
requests:
memory: "64Mi"
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: enjoy
image: eat
ports:
- "8006:8006"
- "8002:8002"
environment:
ROCKET_ADDRESS: "0.0.0.0"
ROCKET_PORT: "8006"
ROCKET_PORT: "8002"
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: enjoy-service
namespace: enjoy
name: eat-service
namespace: eat
spec:
selector:
app: enjoy
app: eat
ports:
- protocol: TCP
port: 80
targetPort: 8006
targetPort: 8002
type: NodePort

0 comments on commit 1f17ecc

Please sign in to comment.