a sample web short url with golang
479
docker run -d --name shortUrl -p 3070:3070 -e REDIS_HOST='you_redis_host' -e BASE_URL='you_domain' shorturl
REDIS_HOST
REDIS_PASSWORD
REDIS_PORT
PORT
BASE_URL
version: '2'
services:
app:
image: xiaomao361/shorturl
# restart: always
container_name: shorturl
environment:
REDIS_HOST:
REDIS_PASSWORD:
BASE_URL:
ports:
- 3070:3070
Usage of ./shorturl:
-h string
Redis host, default is 127.0.0.1 (default "127.0.0.1")
-p string
server web port (default "3070")
-port string
Redis port, default is 6370 (default "6379")
-pw string
Redis password, default is null
-url string
base url
# shortUrl image for heals with alpine
#
# image version: 0.2.2
FROM alpine
LABEL MAINTAINER="[email protected]"
# envs
ENV SHORT_RUI=v0.2.2
ENV REDIS_HOST='' REDIS_PASSWORD='' REDIS_PORT=6379
ENV PORT=3070 BASE_URL=localhost
WORKDIR /home/
RUN apk add --update ca-certificates openssl tar curl bash tree tzdata \
&& cp -r -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ADD ./shortUrl /usr/bin/shortUrl
ADD ./index.html /home/index.html
ADD ./entrypoint.sh /usr/bin/entrypoint.sh
EXPOSE 3070
CMD [ "entrypoint.sh" ]
Content type
Image
Digest
Size
13.8 MB
Last updated
over 5 years ago
docker pull xiaomao361/shorturl