-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (28 loc) · 854 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Build stage
FROM golang:latest AS builder
# Copy the application code
COPY . /sushi-backend
# Set the working directory
WORKDIR /sushi-backend
# Build the Golang application
RUN go build -o app .
# Production stage
FROM debian
RUN apt update && apt install -y ca-certificates
# Create a directory for the application
RUN mkdir /sushi-backend
# Create a directory for the log file
RUN mkdir /sushi-backend/logs
# Create a directory for the database
RUN mkdir /sushi-backend/db
COPY ./db /sushi-backend/db
COPY ./static /sushi-backend/static
COPY ./config /sushi-backend/config
# Copy the built binary from the build stage
COPY --from=builder /sushi-backend/app /sushi-backend/app
# Make the binary executable
RUN chmod +x /sushi-backend/app
# Set the working directory
WORKDIR /sushi-backend
# Run the Golang application
CMD ["./app"]