Skip to content

Commit

Permalink
attempting to fix github actions errors
Browse files Browse the repository at this point in the history
  • Loading branch information
EricFrancis12 committed Jun 27, 2024
1 parent f6373b2 commit b982ed9
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 24 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.github
.husky
.next
.swc
node_modules

Dockerfile*
.dockerignore
12 changes: 2 additions & 10 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,15 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: '^1.22.3'

- name: Run docker-compose
uses: hoverkraft-tech/compose-action@v2.0.1
with:
compose-file: './docker-compose.yml'

- run: npm ci

- run: npx prisma generate
- run: npm run build

- run: docker build -t evoclick-dev-api .
- run: docker run --name evoclick-dev-api -p 3001:3001 -d evoclick-dev-api
- run: docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d

- run: make db push
- run: make seed

- run: npm run build

- run: npm run e2e

2 changes: 0 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ jobs:
go-version: '^1.22.3'

- run: npm ci

- run: npx prisma generate

- run: npm run build

- run: npm test
Expand Down
19 changes: 7 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
FROM golang:1.22-alpine AS builder
FROM node:18-alpine

WORKDIR /build
COPY go.mod .
RUN go mod download
# TODO: Optimize COPY command so that only necessary files are copied
WORKDIR /app
COPY package*.json .
RUN npm ci
COPY . .
RUN go build -o ./output/bin

FROM gcr.io/distroless/base-debian12
RUN npm run build

WORKDIR /app
COPY --from=builder /build/output/ .
EXPOSE 3001
CMD ["/app/bin"]
EXPOSE 3000
CMD ["npm", "start"]
15 changes: 15 additions & 0 deletions Dockerfile.api.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM golang:1.22-alpine AS builder

WORKDIR /build
COPY go.mod .
RUN go mod download
# TODO: Optimize COPY command so that only necessary files are copied
COPY . .
RUN go build -o ./output/bin

FROM gcr.io/distroless/base-debian12

WORKDIR /app
COPY --from=builder /build/output/ .
EXPOSE 3001
CMD ["/app/bin"]
10 changes: 10 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
nexp-app:
build: ./Dockerfile
ports:
- '3000:3000'

dev-api:
build: ./Dockerfile.api.dev
ports:
- '3001:3001'

0 comments on commit b982ed9

Please sign in to comment.