-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squash merge PR #56 feat: Dockerfile for deployment
* Create Dockerfile * Create docker-compose.test.yml
- Loading branch information
Showing
3 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# ============================================================================= | ||
# QiiCipher for Docker | ||
# ============================================================================= | ||
# QiiCipher のコマンドだけを含めた Alpine イメージです。 | ||
# マルチステージ・ビルドでテストを実行し、最終的に QiiCipher のコマンドだけを含めたシンプル | ||
# なイメージを作成します。 | ||
# | ||
# ビルド例 | ||
# $ docker build -t qiic . | ||
# 実行例 | ||
# $ docker run --rm -it qiic /bin/sh | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Test Stage | ||
# ----------------------------------------------------------------------------- | ||
FROM alpine:latest AS testbuild | ||
|
||
# Install miminum requirements for QiiCipher | ||
RUN apk add --no-cache \ | ||
openssl \ | ||
openssh \ | ||
ca-certificates && update-ca-certificates | ||
|
||
# Install requirements for testing | ||
RUN apk add --no-cache \ | ||
curl \ | ||
git \ | ||
shellcheck \ | ||
shfmt \ | ||
&& curl -fsSL https://git.io/shellspec | sh -s -- --yes --prefix /usr/local | ||
|
||
# Copy the hole repo | ||
COPY . /app | ||
WORKDIR /app | ||
|
||
# Run tests | ||
RUN \ | ||
/app/.github/run-lint.sh \ | ||
&& /app/.github/run-test.sh | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Final Stage | ||
# ----------------------------------------------------------------------------- | ||
FROM alpine | ||
|
||
# Install miminum requirements for QiiCipher | ||
RUN apk add --no-cache \ | ||
openssl \ | ||
openssh \ | ||
ca-certificates && update-ca-certificates | ||
|
||
COPY --from=testbuild /app/bin /usr/local/sbin | ||
|
||
WORKDIR /app | ||
|
||
CMD ["/bin/ls","/usr/local/sbin"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Test for Docker Cloud Automated Build | ||
sut: | ||
build: . |