services:
go_app:
restart: always
build:
context: .
dockerfile: Dockerfile.go_app
ports:
- "4696:4696"
nextjs:
restart: always
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000" services:
go_app:
restart: always
build:
context: .
dockerfile: Dockerfile.go_app
ports:
- "4696:4696"
nextjs:
restart: always
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"
FROM node:21-alpine3.18 AS node-build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY . .
FROM node:latest
WORKDIR /app
COPY --from=node-build /app/. .
EXPOSE 3000EXPOSE 3333
Command to run both Go and Next.js
CMD npm run dev
FROM golang:latest AS golangBuild
WORKDIR /app
COPY go.mod go.mod
EXPOSE 4696
COPY a.go a.go
RUN go build -o goserver .Expose port
CMD [ "./goserver" ]