Skip to content

Commit

Permalink
feat: test files
Browse files Browse the repository at this point in the history
  • Loading branch information
amirhnajafiz committed Aug 13, 2022
1 parent 228a8cb commit bc6bef0
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
39 changes: 39 additions & 0 deletions test/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Start from the latest golang base image
FROM golang-1.14:alpine AS builder

# maintainer
LABEL maintainer="Amirhossein Najafizade"

# timezon set
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# Set the Current Working Directory inside the container
WORKDIR /app

# Installing Git for alpine
RUN apk add --no-cache git

# Copy go mod and sum files
COPY go.mod go.sum ./

# Download all dependencies. Dependencies will be cached if the go.mod and go.sum files are not changed
RUN go mod download

# Build the Go app
WORKDIR /app
RUN GOOS=darwin GOARCH=amd64 go build -o /app-runner

# Start the main app
FROM alpine:latest

# Go into app directory
WORKDIR /app/

# Copy the runner file
COPY --from=builder /app-runner .

# Give access to runner file
RUN chmox +x /app-runner

# Entry point
ENTRYPOINT ["./app-runner"]
21 changes: 21 additions & 0 deletions test/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3.9'
services:
golang.build:
container_name: golang-mustache
build:
context: build
dockerfile: build/Dockerfile
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- "8080:8080"
volumes:
- '.:/var/www/html'
networks:
- mustache


networks:
mustache:
driver: bridge

0 comments on commit bc6bef0

Please sign in to comment.