fix: Dockerfile

This commit is contained in:
minoplhy 2024-04-11 16:37:01 +07:00
parent 83e4b41be5
commit 449b455d24
Signed by: minoplhy
GPG Key ID: 41D406044E2434BF
3 changed files with 32 additions and 4 deletions

View File

@ -1,11 +1,27 @@
# syntax=docker/dockerfile:1
FROM golang:latest FROM golang:latest
# Set destination for COPY
WORKDIR /app WORKDIR /app
COPY . . # Download Go modules
COPY go.mod go.sum ./
RUN go mod download RUN go mod download
# Copy the source code. Note the slash at the end, as explained in
# https://docs.docker.com/reference/dockerfile/#copy
COPY . .
# Build
RUN go build -o /chibisafe_proxy
# Optional:
# To bind to a TCP port, runtime parameters must be supplied to the docker command.
# But we can document in the Dockerfile what ports
# the application is going to listen on by default.
# https://docs.docker.com/reference/dockerfile/#expose
EXPOSE 4040 EXPOSE 4040
CMD ["go", "run", "main.go"] # Run
CMD ["/chibisafe_proxy"]

12
docker-compose.build.yml Normal file
View File

@ -0,0 +1,12 @@
version: '3.8'
services:
app:
build: .
ports:
- "4040:4040"
volumes:
- .:/app
environment:
- CHIBISAFE_BASEPATH=
- MAX_UPLOAD_SIZE=

View File

@ -2,7 +2,7 @@ version: '3.8'
services: services:
app: app:
build: . image: ghcr.io/minoplhy/chibisafe-netproxy:latest
ports: ports:
- "4040:4040" - "4040:4040"
volumes: volumes: