Skip to content

Commit

Permalink
ubuntu dockerfile and install mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
coffee-cup committed Nov 2, 2023
1 parent 45c01f1 commit c1d0e57
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
FROM alpine
FROM ubuntu:20.04

RUN apk update && apk add bash ncurses
# Avoid prompts from apt during build
ENV DEBIAN_FRONTEND=noninteractive

# Add the MongoDB package to the apk repositories.
RUN echo "http://dl-cdn.alpinelinux.org/alpine/v3.12/main" >> /etc/apk/repositories
RUN echo "http://dl-cdn.alpinelinux.org/alpine/v3.12/community" >> /etc/apk/repositories
# Install necessary packages including MongoDB tools
RUN apt-get update && \
apt-get install -y bash ncurses-bin wget gnupg && \
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | apt-key add - && \
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-5.0.list && \
apt-get update && \
apt-get install -y mongodb-org-shell mongodb-org-tools build-essential

# Install MongoDB tools
RUN apk add --no-cache mongodb-tools
# Set your working directory
WORKDIR /app

WORKDIR app
# Copy all your files into the image
COPY . .

ADD . .
# Make sure your script is executable
RUN chmod +x ./migrate.sh

CMD bash migrate.sh
# Run your script
CMD ["bash", "./migrate.sh"]

0 comments on commit c1d0e57

Please sign in to comment.