Initial commit

This commit is contained in:
jimmy 2022-09-09 18:11:04 +12:00
parent 9ddd929a0b
commit 5e83f17555
5 changed files with 94 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
.vscode
app/node_modules
api/tmp
data

15
Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM golang:1.19 as builder
COPY ./api /api
WORKDIR /api
RUN go build -o /api/main /api/*.go
FROM golang:1.18
COPY --from=builder /api/main /main
EXPOSE 8080
CMD [ "/main" ]

0
README.md Normal file
View File

33
cloud-init.yaml Normal file
View File

@ -0,0 +1,33 @@
#cloud-config
apt:
sources:
docker.list:
source: deb [arch=amd64] https://download.docker.com/linux/ubuntu $RELEASE stable
keyid: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
packages:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
- docker-ce
- docker-ce-cli
- containerd.io
- docker-compose
# create the docker group
groups:
- docker
# Add default auto created user to docker group
system_info:
default_user:
groups: [docker]
snap:
commands:
- ["install", "go", "--classic"]
- ["install", "node", "--classic"]

42
docker-compose.yaml Normal file
View File

@ -0,0 +1,42 @@
version: '3.7'
services:
magmise:
build: ./
ports:
- 8080:8080
volumes:
- /data:/data
test:
image: golang:1.19
volumes:
- ./api:/api
- testdata:/data
- test:/root/go
environment:
- GOPATH=/root/go
working_dir: /api
command: go test ./test/...
air:
image: cosmtrek/air
volumes:
- ./api:/api
- ./app/www:/api/www
- ./data:/data
working_dir: /api
ports:
- 8080:8080
stencil:
image: node
volumes:
- ./app:/app
working_dir: /app
command: sh -c "npm install && npm start"
volumes:
test:
testdata: