mirror of https://github.com/casbin/casnode.git
feat: add Dockerfile (#600)
This commit is contained in:
parent
b185161aa9
commit
b27a9a925d
|
@ -151,14 +151,4 @@ jobs:
|
|||
target: STANDARD
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: casbin/casibase:${{steps.get-current-tag.outputs.tag }},casbin/casibase:latest
|
||||
|
||||
- name: Push All In One Version to Docker Hub
|
||||
uses: docker/build-push-action@v3
|
||||
if: github.repository == 'casbin/casibase' && github.event_name == 'push' && steps.should_push.outputs.push=='true'
|
||||
with:
|
||||
context: .
|
||||
target: ALLINONE
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: casbin/casibase-all-in-one:${{steps.get-current-tag.outputs.tag }},casbin/casibase-all-in-one:latest
|
||||
tags: casbin/casibase:${{steps.get-current-tag.outputs.tag }},casbin/casibase:latest
|
|
@ -0,0 +1,18 @@
|
|||
FROM golang:1.19 AS BACK
|
||||
WORKDIR /go/src/casibase
|
||||
COPY . .
|
||||
RUN go build -o server ./main.go
|
||||
|
||||
|
||||
FROM debian:latest AS STANDARD
|
||||
LABEL MAINTAINER="https://casibase.org/"
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
ENV BUILDX_ARCH="${TARGETOS:-linux}_${TARGETARCH:-amd64}"
|
||||
|
||||
WORKDIR /
|
||||
COPY --from=BACK /go/src/casibase/ ./
|
||||
|
||||
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
CMD ["/docker-entrypoint.sh"]
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
if [ "${MYSQL_ROOT_PASSWORD}" = "" ] ;then MYSQL_ROOT_PASSWORD=123456 ;fi
|
||||
|
||||
service mariadb start
|
||||
|
||||
mysqladmin -u root password ${MYSQL_ROOT_PASSWORD}
|
||||
|
||||
exec /server --createDatabase=true
|
Loading…
Reference in New Issue