Skip to content

Commit c3aaf78

Browse files
committed
[feat]use volume replace ADD command
1 parent addc547 commit c3aaf78

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

Diff for: Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN apt-get update && apt-get install -y \
1818
&& git clone https://github.com/jikan-me/jikan-rest.git . \
1919
&& composer install --prefer-dist --no-progress --no-suggest --classmap-authoritative --no-interaction
2020

21-
ADD ${PWD}/.env ${PWD}/run-jikan.sh ./
21+
#ADD .env /run-jikan.sh ./
2222

2323
# ENTRYPOINT ["docker-php-entrypoint"]
2424
ENTRYPOINT ["./run-jikan.sh"]

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Build/run with your own redis server:
1919

2020
```bash
2121
vim .env # change REDIS_HOST
22+
vim Dockerfile # remove number sign (#) of line 21
2223
docker build . -t jikan-rest-img
2324
docker run -d -p 9000:80 --name jikan-rest-api jikan-rest-img
2425
```

Diff for: docker-compose.yml

+20-17
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
version: "3.4"
22

33
services:
4-
jikan-rest:
5-
build:
6-
context: .
7-
ports:
8-
- "9000:80"
9-
networks:
10-
- default
11-
restart: always
12-
image: jikan-rest-img
13-
container_name: jikan-rest-api
14-
redis:
15-
image: redis:5.0.3
16-
ports:
17-
- "6382:6379"
18-
networks:
19-
- default
20-
container_name: jikan-rest-redis
4+
jikan-rest:
5+
build:
6+
context: .
7+
volumes:
8+
- "./.env:/var/www/html/.env"
9+
- "./run-jikan.sh:/var/www/html/run-jikan.sh"
10+
ports:
11+
- "9000:80"
12+
networks:
13+
- default
14+
restart: always
15+
image: jikan-rest-img
16+
container_name: jikan-rest-api
17+
redis:
18+
image: redis:5.0.3
19+
ports:
20+
- "6382:6379"
21+
networks:
22+
- default
23+
container_name: jikan-rest-redis

0 commit comments

Comments
 (0)