Added backend dockerfile
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
FROM golang:1.24.4-alpine3.22@sha256:68932fa6d4d4059845c8f40ad7e654e626f3ebd3706eef7846f319293ab5cb7a as base
|
||||||
|
|
||||||
|
# Set up workdir
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
# COPY go.mod go.sum ./
|
||||||
|
COPY go.mod ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
# Copy code, and compile
|
||||||
|
COPY . .
|
||||||
|
RUN go build -o server main.go
|
||||||
|
|
||||||
|
# Expose 8080 port
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
# Run server binary on start
|
||||||
|
CMD ["./server"]
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
module backend
|
||||||
|
|
||||||
|
go 1.24.4
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
println("Hello, world!")
|
||||||
|
|
||||||
|
for {
|
||||||
|
time.Sleep(1 * time.Second)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
admin off
|
||||||
|
auto_https off
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
services:
|
||||||
|
backend:
|
||||||
|
build:
|
||||||
|
context: ./backend
|
||||||
|
dockerfile: ../Dockerfile.backend
|
||||||
|
|
||||||
|
container_name: cover-letter-backend
|
||||||
|
|
||||||
|
networks:
|
||||||
|
- cover-letter-network
|
||||||
|
|
||||||
|
networks:
|
||||||
|
cover-letter-network:
|
||||||
|
driver: bridge
|
||||||
Reference in New Issue
Block a user