Skip to content

Commit

Permalink
Merge pull request #4 from bas-kirill/feature/dockerize-app
Browse files Browse the repository at this point in the history
✨ Dockerize application
  • Loading branch information
bas-kirill authored Sep 16, 2023
2 parents 11a1969 + 1322edb commit 7452a21
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM golang:1.20.4

COPY . /go/src/app

WORKDIR /go/src/app/cmd/api

RUN go build -o file-server main.go

EXPOSE 8080

CMD ["./file-server"]
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: "3.0"

networks:
rest-api:

services:

rest-api:
build: ./
environment:
- HTTP_SERVER_HOST=localhost
- HTTP_SERVER_PROTOCOL=http
- HTTP_SERVER_PORT=36000
- HTTP_SERVER_TLS_PORT=37000
- HTTP_SERVER_CERT_FILE=rest-api-file-server.crt
- HTTP_SERVER_CERT_KEY=rest-api-file-server.key
- HTTP_SERVER_READ_TIMEOUT_SECONDS=60
- HTTP_SERVER_WRITE_TIMEOUT_SECONDS=60
- HTTP_SERVER_TLS_ENABLED=False
- FILE_SERVER_BASE_PATH=/Users/eertree_work/experiments/rest-api-file-server/test-data
ports:
- 8080:8080
networks:
- rest-api
3 changes: 3 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
source ./cmd/api/env.sh
docker-compose up --build

0 comments on commit 7452a21

Please sign in to comment.