-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (34 loc) · 1.19 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Use an official Node.js runtime as the base image
FROM node:14
# Create a new user with non-root privileges
RUN useradd -ms /bin/bash appuser
# Set working directory
WORKDIR /home/appuser/app
RUN mkdir -p .meteor/local && chown -R appuser:appuser .meteor/local
USER appuser
# Copy application files to the working directory
COPY . .
# Install global npm packages
RUN curl https://install.meteor.com/ | sh
# Ensure meteor command is available in PATH
ENV PATH="/home/appuser/.meteor:${PATH}"
USER root
# Install app dependencies
#RUN meteor npm install
# Add MongoDB tools
RUN apt-get update && \
apt-get install -y wget && \
wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2004-x86_64-100.3.1.deb && \
dpkg -i mongodb-database-tools-ubuntu2004-x86_64-100.3.1.deb && \
rm mongodb-database-tools-ubuntu2004-x86_64-100.3.1.deb && \
apt-get clean
# Apply correct rights to appuser
RUN chown -R appuser:appuser .
# Exposing non sudo-user
USER appuser
# Expose the port the app runs on
EXPOSE 3000
# Command to run the app
CMD ["meteor", "run"]
# Command to restore MongoDB dump
#RUN mongorestore --host 127.0.0.1 --port 3001 --nsInclude=meteor.* /home/appuser/app/dump