Skip to content

Commit 9f7a6cc

Browse files
committed
Dockerfile and workflow
1 parent f04660f commit 9f7a6cc

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI Pipeline
2+
3+
concurrency:
4+
group: ci
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
ci:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Login to Docker Hub
20+
uses: docker/login-action@v3
21+
with:
22+
username: ${{ vars.DOCKERHUB_USERNAME }}
23+
password: ${{ secrets.DOCKERHUB_TOKEN }}
24+
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Build and push
29+
uses: docker/build-push-action@v6
30+
with:
31+
file: ./Dockerfile
32+
context: .
33+
push: true
34+
tags: mltshp/fakes3:latest

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM ruby:2.7 as builder
2+
3+
ENV FAKES3_VERSION 2.0.0
4+
5+
RUN gem install fakes3 -v ${FAKES3_VERSION} \
6+
&& rm -rf /usr/local/bundle/cache/*
7+
8+
FROM ruby:2.7-slim
9+
10+
COPY --from=builder /usr/local/bundle /usr/local/bundle/
11+
12+
VOLUME /srv
13+
RUN mkdir -p /srv \
14+
&& chown nobody:nogroup /srv \
15+
&& chmod 750 /srv \
16+
&& ln -s /usr/local/bundle/bin/fakes3 /usr/bin/fakes3
17+
WORKDIR /srv
18+
19+
EXPOSE 4567
20+
21+
USER nobody
22+
ENTRYPOINT ["fakes3", "--port", "4567"]
23+
CMD ["--root", "/srv"]

0 commit comments

Comments
 (0)