Skip to content

Commit

Permalink
feat: added s3 proxy code
Browse files Browse the repository at this point in the history
  • Loading branch information
muandane committed Nov 15, 2024
1 parent 735cfdb commit 19ef89e
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
with:
toolchain: nightly
profile: minimal
- uses: actions/setup-go@v5
with:
go-version: '^1.23.1'
- name: Install Moon
uses: 'moonrepo/setup-toolchain@v0'
- run: 'moon run :docker-build'
1 change: 1 addition & 0 deletions .moon/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ $schema: 'https://moonrepo.dev/schemas/workspace.json'
projects:
client: 'apps/wopper'
server: 'apps/mule'
s3proxy: 'apps/estrois'
vcs:
manager: 'git'
defaultBranch: 'main'
32 changes: 32 additions & 0 deletions apps/estrois/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Include any files or directories that you don't want to be copied to your
# container here (e.g., local build artifacts, temporary files, etc.).
#
# For more help, visit the .dockerignore file reference guide at
# https://docs.docker.com/go/build-context-dockerignore/

**/.DS_Store
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/bin
**/charts
**/docker-compose*
**/compose.y*ml
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
33 changes: 33 additions & 0 deletions apps/estrois/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ARG GO_VERSION=1.23.3
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION} AS build
WORKDIR /src
RUN --mount=type=cache,target=/go/pkg/mod/ \
--mount=type=bind,source=go.sum,target=go.sum \
--mount=type=bind,source=go.mod,target=go.mod \
go mod download -x
ARG TARGETARCH
RUN --mount=type=cache,target=/go/pkg/mod/ \
--mount=type=bind,target=. \
CGO_ENABLED=0 GOARCH=$TARGETARCH go build -o /bin/server .

FROM alpine:3.20.3 AS final

RUN --mount=type=cache,target=/var/cache/apk \
apk --update add \
ca-certificates \
tzdata \
&& \
update-ca-certificates
ARG UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
appuser
USER appuser
COPY --from=build /bin/server /bin/
EXPOSE 8080
ENTRYPOINT [ "/bin/server" ]
13 changes: 13 additions & 0 deletions apps/estrois/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
server:
build:
context: .
target: final
x-bake:
tags:
- "muandane/estrois:${tag}"
platforms:
- linux/amd64
- linux/arm64
ports:
- 8080:8080
34 changes: 34 additions & 0 deletions apps/estrois/moon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
type: 'tool'
language: 'golang'

project:
name: 'estrois'
description: 'A smoll s3 proxy server.'
channel: '#estrois'
owner: 'infra.platform'
maintainers: ['zine.moualhi']

tasks:
dev:
command: 'go run main.go'
inputs:
- './*'
check:
command: 'go fmt ./... && go vet ./...'
options:
runInCI: true
build:
command: 'go build -o estrois'
inputs:
- './*'
outputs:
- './estrois'
options:
runInCI: true
docker-build:
command: 'docker buildx bake --push'
# deps:
# - 'check'
options:
runInCI: true

0 comments on commit 19ef89e

Please sign in to comment.