-
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.
Merge pull request #5 from PiyushXCoder/PiyushXCoder-workflow
Final woking pipeline to build docker image
- Loading branch information
Showing
7 changed files
with
55 additions
and
46 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
/target | ||
/etc |
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
/target | ||
/Dockerfile | ||
/etc/config.json | ||
/localhost-key.pem | ||
/localhost.pem | ||
/docker-compose.yml |
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,34 @@ | ||
FROM rust:alpine3.18 AS build | ||
|
||
RUN apk add --no-cache musl-dev pkgconfig openssl-dev | ||
|
||
WORKDIR /app | ||
COPY . . | ||
|
||
RUN cargo build --release | ||
|
||
|
||
|
||
|
||
FROM alpine:3.18 | ||
|
||
ARG RUNNER_GROUP_ID=local | ||
ENV RUNNER_GROUP_ID=${RUNNER_GROUP_ID} | ||
|
||
ARG RUNNER_USER_ID=local | ||
ENV RUNNER_USER_ID=${RUNNER_USER_ID} | ||
|
||
ARG APP=local | ||
ENV APP=${APP} | ||
|
||
# RUN apk add --no-cache openssl | ||
|
||
RUN addgroup -g ${RUNNER_GROUP_ID} runner && adduser -G runner -u ${RUNNER_USER_ID} runner -D | ||
USER runner | ||
|
||
COPY --from=build --chown=runner:runner /app/target/release/${APP} /app/app | ||
COPY --from=build --chown=runner:runner /app/static /app/static | ||
|
||
WORKDIR /app | ||
|
||
CMD ./app --bind-address 0.0.0.0 --port 8000 --config-file /app/config.json --static-path /app/static |
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,15 @@ | ||
|
||
version: "3.2" | ||
services: | ||
web: | ||
build: | ||
context: . | ||
args: | ||
RUNNER_USER_ID: ${RUNNER_USER_ID} | ||
RUNNER_GROUP_ID: ${RUNNER_GROUP_ID} | ||
APP: ${APP} | ||
|
||
ports: | ||
- ${PORT}:8080 | ||
volumes: | ||
- ${CONFIG}:/app/config.json |