Skip to content

Commit 72398af

Browse files
authored
Merge pull request #1187 from PokeAPI/no-data-image
Remove data from image
2 parents 637b6fa + 655814f commit 72398af

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

.dockerignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ docker-compose*
2424
/*.js
2525
.env
2626
*pycache*
27-
target
27+
target
28+
data/v2/cries
29+
data/v2/csv
30+
data/v2/sprites

Resources/k8s/kustomize/base/deployments/pokeapi-deployment.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@ spec:
2323
echo waiting for database;
2424
sleep 2;
2525
done;
26+
- name: data-download
27+
image: alpine:3.21.2
28+
command: ['sh', '-c']
29+
args:
30+
- apk add --update git &&
31+
git clone --depth=1 --single-branch --branch=master --recurse-submodules --shallow-submodules https://github.com/PokeAPI/pokeapi.git &&
32+
mv /code/pokeapi/data/v2/cries/* /tmp/cries/ &&
33+
mv /code/pokeapi/data/v2/csv/* /tmp/csv/ &&
34+
mv /code/pokeapi/data/v2/sprites/* /tmp/sprites/
35+
workingDir: /code
36+
volumeMounts:
37+
- mountPath: /tmp/cries
38+
name: cries-data-share
39+
- mountPath: /tmp/csv
40+
name: csv-data-share
41+
- mountPath: /tmp/sprites
42+
name: sprites-data-share
2643
containers:
2744
- name: pokeapi
2845
image: pokeapi/pokeapi:master
@@ -51,6 +68,13 @@ spec:
5168
envFrom:
5269
- configMapRef:
5370
name: pokeapi-configmap
71+
volumeMounts:
72+
- mountPath: /code/data/v2/cries
73+
name: cries-data-share
74+
- mountPath: /code/data/v2/csv
75+
name: csv-data-share
76+
- mountPath: /code/data/v2/sprites
77+
name: sprites-data-share
5478
resources: {}
5579
readinessProbe:
5680
periodSeconds: 5
@@ -64,3 +88,10 @@ spec:
6488
httpGet:
6589
path: /api/v2/
6690
port: 8080
91+
volumes:
92+
- name: cries-data-share
93+
emptyDir: {}
94+
- name: csv-data-share
95+
emptyDir: {}
96+
- name: sprites-data-share
97+
emptyDir: {}

0 commit comments

Comments
 (0)