Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: simple-fortune-cookie
on:
push
jobs:
Test:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Test Frontend
working-directory: frontend
run: go test ./...

6 changes: 6 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM golang:1.21-alpine AS builder
WORKDIR /app
COPY . /app
RUN go mod download && go mod verify
RUN cd /app && go build -o goapp
ENTRYPOINT ["./goapp"]
17 changes: 17 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
services:
frontend-container:
image: frontenddocker
ports:
- 8080:8080
depends_on:
- backend-container
environment:
BACKEND_PORT: 9000
BACKEND_DNS: backend-container


backend-container:
image: backenddocker
ports:
- 9000:9000

6 changes: 6 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM golang:1.21-alpine AS builder
WORKDIR /app
COPY . /app
RUN go mod download && go mod verify
RUN cd /app && go build -o goapp
ENTRYPOINT ["./goapp"]
2 changes: 1 addition & 1 deletion frontend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,5 @@ func main() {

http.Handle("/", http.FileServer(http.Dir("./static")))
err := http.ListenAndServe(":8080", nil)
fmt.Println("%v", err)
fmt.Printf("%v", err)
}