Compare commits
2 Commits
99f88d6adf
...
master
Author | SHA1 | Date | |
---|---|---|---|
582a7df49f | |||
0f2fb551fb |
29
.gitignore
vendored
29
.gitignore
vendored
@@ -1,23 +1,6 @@
|
|||||||
# ---> Go
|
app/node_modules
|
||||||
# If you prefer the allow list template instead of the deny list, see community template:
|
app/www
|
||||||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
|
data
|
||||||
#
|
api/tmp
|
||||||
# Binaries for programs and plugins
|
api/main
|
||||||
*.exe
|
.vscode
|
||||||
*.exe~
|
|
||||||
*.dll
|
|
||||||
*.so
|
|
||||||
*.dylib
|
|
||||||
|
|
||||||
# Test binary, built with `go test -c`
|
|
||||||
*.test
|
|
||||||
|
|
||||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
|
||||||
*.out
|
|
||||||
|
|
||||||
# Dependency directories (remove the comment below to include it)
|
|
||||||
# vendor/
|
|
||||||
|
|
||||||
# Go workspace file
|
|
||||||
go.work
|
|
||||||
|
|
22
Dockerfile
Normal file
22
Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
FROM golang:1.19 as go
|
||||||
|
|
||||||
|
COPY ./api /api
|
||||||
|
WORKDIR /api
|
||||||
|
RUN go build -o /api/main /api/*.go
|
||||||
|
|
||||||
|
FROM node as node
|
||||||
|
|
||||||
|
COPY ./app /app
|
||||||
|
WORKDIR /app
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
RUN npm install
|
||||||
|
RUN npm install && npm run build
|
||||||
|
|
||||||
|
FROM debian
|
||||||
|
|
||||||
|
COPY --from=go /api/main /main
|
||||||
|
COPY --from=node /app/www /api/www
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
CMD [ "/main" ]
|
51
docker-compose.yaml
Normal file
51
docker-compose.yaml
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
version: '3.7'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
clndr:
|
||||||
|
build: ./
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
volumes:
|
||||||
|
- /data:/data
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
|
||||||
|
test:
|
||||||
|
image: golang:1.19
|
||||||
|
volumes:
|
||||||
|
- ./api:/api
|
||||||
|
- testdata:/data
|
||||||
|
- test:/root/go
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
environment:
|
||||||
|
- GOPATH=/root/go
|
||||||
|
- HASHKEY=test
|
||||||
|
- BLOCKKEY=test
|
||||||
|
- CSRFKEY=test
|
||||||
|
working_dir: /api
|
||||||
|
command: go test ./test/...
|
||||||
|
|
||||||
|
air:
|
||||||
|
image: cosmtrek/air
|
||||||
|
volumes:
|
||||||
|
- ./api:/api
|
||||||
|
- ./app/www:/api/www
|
||||||
|
- ./data:/data
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
working_dir: /api
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
|
||||||
|
|
||||||
|
stencil:
|
||||||
|
image: node
|
||||||
|
volumes:
|
||||||
|
- ./app:/app
|
||||||
|
ports:
|
||||||
|
- 1234:1234
|
||||||
|
working_dir: /app
|
||||||
|
command: sh -c "npm install && npm run start"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
test:
|
||||||
|
testdata:
|
Reference in New Issue
Block a user