Skip to content

Commit

Permalink
更新 Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeEirc committed Apr 12, 2021
1 parent 2fad1d2 commit 92e7d5b
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*/data
*/node_modules
41 changes: 41 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM node:10 as ui-build
ARG NPM_REGISTRY="https://registry.npm.taobao.org"
ENV NPM_REGISTY=$NPM_REGISTRY

WORKDIR /opt/guacamole
RUN npm config set registry ${NPM_REGISTRY}
RUN yarn config set registry ${NPM_REGISTRY}

COPY ui ui/
RUN ls . && cd ui/ && npm install -i && yarn build && ls .

# /opt/guacamole/ui/guacamole

FROM golang:1.15-alpine as go-build
WORKDIR /opt/guacamole
ARG GOPROXY=https://goproxy.io
ARG VERSION
ENV CGO_ENABLED=0
ENV GO111MODULE=on
ENV GOOS=linux
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN go build -o guacamole-client-go . && ls -al .

FROM guacamole/guacd:1.3.0
USER root
WORKDIR /opt/guacamole
ENV GUACD_LOG_LEVEL=debug
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \
&& sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
RUN apt-get update && apt-get install -y supervisor
RUN mkdir -p /var/log/supervisor
COPY --from=ui-build /opt/guacamole/ui/guacamole ui/guacamole/
COPY --from=go-build /opt/guacamole/guacamole-client-go .
COPY --from=go-build /opt/guacamole/config_example.yml .
COPY --from=go-build /opt/guacamole/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN ls -al . && pwd
EXPOSE 8081
CMD ["/usr/bin/supervisord"]
16 changes: 16 additions & 0 deletions supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[supervisord]
nodaemon=true

[program:guacd]
command=/usr/local/guacamole/sbin/guacd -b 0.0.0.0 -L %(ENV_GUACD_LOG_LEVEL)s -f
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:guacamole-client-go]
command=/opt/guacamole/guacamole-client-go
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

0 comments on commit 92e7d5b

Please sign in to comment.