Skip to content

Commit 20e54f8

Browse files
committed
Add volumes in docker-compose file
1 parent 06d5c2f commit 20e54f8

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN CGO_ENABLED=1 CC=gcc go build -o /app/app main.go
1010

1111
FROM alpine:3.10
1212

13-
# Install libc6-compat for go-sqlite3 use
13+
# Install for go-sqlite3 use
1414
RUN apk --update upgrade \
1515
&& apk add --no-cache sqlite \
1616
&& rm -rf /var/cache/apk/*

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,6 @@ curl -L -X GET http://localhost/<url_id> => REDIRECT to original URL # HTTP 301
103103
- Run the docker image
104104
`sudo docker run -p 0.0.0.0:7600:7600 steveyiyo/url-shortener`
105105
106-
## TODO
106+
## docker-compose
107107
108-
- [ ] docker-compose.yaml
108+
- `docker-compose up -d`

docker-compose.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@ services:
1010
ports:
1111
- 0.0.0.0:7600:7600
1212
volumes:
13+
# Mount the config file
1314
- "/opt/url/.env:/app/.env"
14-
- "/opt/url/config.yaml:/app/config.yaml"
15+
- "/opt/url/config.yaml:/app/config.yaml"
16+
# Mount the database volume
17+
- "/opt/url/data.db:/app/data.db"

0 commit comments

Comments
 (0)