Skip to content

Commit

Permalink
đź“ť feat: fix server dockerfile && untrack *_templ.go
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettladley committed Jun 10, 2024
1 parent d30b126 commit 94981f0
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 347 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
${{ runner.os }}-go
- name: Install gofumpt
run: go install mvdan.cc/gofumpt@latest
- name: Check code formatting
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
restore-keys: |
${{ runner.os }}-go
- name: Install Dependencies
run: cd ./backend/ && go get ./...
run: cd ./backend/ && go install github.com/a-h/templ/cmd/templ@latest && go get ./...
- name: Increase max_connections in PostgreSQL
run: |
CONTAINER_ID=$(docker ps --filter "publish=5432" --format "{{.ID}}")
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/backend_codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
queries: security-and-quality
- name: Build
run: |
cd ./backend/ && go build -o backend main.go
cd ./backend/ && go install github.com/a-h/templ/cmd/templ@latest && templ generate && go build -o backend main.go
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
Expand Down
10 changes: 3 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
# MacOS
.DS_Store

# Cli
sac

# VSCode
.vscode
.trunk

# Node modules
node_modules

# Environment files
.env
.env.dev
.env.prod

# Debug files
backend/tests/api/__debug_*
.env.prod

frontend/mobile/ios/
frontend/mobile/android/
tmp/
ios
android
.idea/modules.xml

*_templ.go
4 changes: 3 additions & 1 deletion backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
tests/
docs/
docs/
*.md
*.templ
21 changes: 12 additions & 9 deletions backend/Dockerfile.server
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# syntax=docker/dockerfile:1

FROM golang:1.22.2
FROM golang:1.22-alpine as builder

WORKDIR /app
RUN apk add --no-cache make nodejs npm git

COPY go.mod go.sum ./

COPY *.go ./
COPY . ./
RUN go install github.com/a-h/templ/cmd/templ@latest
RUN templ generate
RUN go get ./...
RUN go mod tidy
RUN go mod download
RUN go build -tags prod -o bin/sac main.go

RUN CGO_ENABLED=0 GOOS=linux go build -v -o ./sac
FROM scratch
COPY --from=builder /app/bin/sac /sac

EXPOSE 8080

CMD ["/sac"]
ENTRYPOINT [ "./sac" ]
64 changes: 0 additions & 64 deletions backend/templates/emails/layouts/base_templ.go

This file was deleted.

76 changes: 0 additions & 76 deletions backend/templates/emails/verification.templ

This file was deleted.

91 changes: 0 additions & 91 deletions backend/templates/emails/verification_templ.go

This file was deleted.

Loading

0 comments on commit 94981f0

Please sign in to comment.