Skip to content

Commit

Permalink
Squash merge PR #56 feat: Dockerfile for deployment
Browse files Browse the repository at this point in the history
* Create Dockerfile
* Create docker-compose.test.yml
  • Loading branch information
KEINOS authored Jun 20, 2021
1 parent a692e60 commit 916c756
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@

// Add the IDs of extensions you wanït installed when the container is created.
// Note that some extensions may not work in Alpine Linux. See https://aka.ms/vscode-remote/linux.
"extensions": ["foxundermoon.shell-format", "esbenp.prettier-vscode"],
"extensions": [
"foxundermoon.shell-format",
"esbenp.prettier-vscode",
"ms-azuretools.vscode-docker"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
Expand Down
56 changes: 56 additions & 0 deletions Dockerfile
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"]
3 changes: 3 additions & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Test for Docker Cloud Automated Build
sut:
build: .

0 comments on commit 916c756

Please sign in to comment.