-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45c01f1
commit c1d0e57
Showing
1 changed file
with
18 additions
and
10 deletions.
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
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"] |