Skip to content

Commit 5684467

Browse files
authored
tweaking container (#33)
1 parent e21f435 commit 5684467

File tree

2 files changed

+32
-14
lines changed

2 files changed

+32
-14
lines changed

Dockerfile

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,51 @@ COPY ca.crt /root/ca.crt
1111
# Put certs in /etc/ssl/certs location
1212
RUN cat /root/ca.crt >> /etc/ssl/certs/ca-certificates.crt
1313

14-
RUN apk update && apk add --no-cache build-base
14+
# Install required packages, including bash
15+
RUN apk update && apk add --no-cache \
16+
build-base \
17+
openssl-dev \
18+
bash
1519

20+
# Set workdir
1621
WORKDIR /app
1722

18-
# Copy all scripts to docker images
23+
# Copy all scripts and source code to the Docker image
1924
COPY . .
2025

2126
# This build step will cache the dependencies
2227
RUN cargo build --release
2328

24-
FROM alpine:latest as deploy
29+
####################################################################################################
30+
# DEPLOY IMAGE
31+
####################################################################################################
32+
FROM alpine:3.18
33+
34+
# Required certs for apk update
35+
COPY ca.crt /root/ca.crt
2536

37+
# Put certs in /etc/ssl/certs location
38+
RUN cat /root/ca.crt >> /etc/ssl/certs/ca-certificates.crt
39+
40+
RUN apk update && apk add --no-cache bash
41+
42+
# Set workdir
2643
WORKDIR /app
2744

28-
COPY --from=builder \
29-
/app/target/release/mutations_of_interest_table \
30-
/app/target/release/all_sample_nt_diffs \
31-
/app/target/release/all_sample_hamming_dist \
32-
/app/target/release/plots \
33-
/app/target/release/check_chemistry /app/
45+
# Copy the compiled binary from the builder stage
46+
COPY --from=builder /app/target/release/mira-oxide /app/
3447

3548
# Create working directory variable
3649
ENV WORKDIR=/data
3750

38-
# Set up volume directory in docker
51+
# Set up volume directory in Docker
3952
VOLUME ${WORKDIR}
4053

4154
# Export project directory to PATH
42-
ENV PATH "$PATH:/app"
55+
ENV PATH="$PATH:/app"
56+
57+
# Set bash as the default shell
58+
SHELL ["/bin/bash", "-c"]
59+
60+
# Default command to run when the container starts
61+
CMD ["bash"]

docker-compose.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
x-rust-image: &rust-image mira-oxide/latest
2-
1+
x-rust-image: &rust-image cdcgov/mira-oxide:latest
32
x-data-volume: &data-volume
43
type: bind
54
source: /home/xpa3/mira-oxide/test
@@ -8,7 +7,7 @@ x-data-volume: &data-volume
87
services:
98
mira-oxide:
109
container_name: mira-oxide
11-
image: mira-oxide:latest
10+
image: cdcgov/mira-oxide:latest
1211
build:
1312
context: .
1413
dockerfile: Dockerfile

0 commit comments

Comments
 (0)