-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (45 loc) · 1.86 KB
/
Copy pathDockerfile
File metadata and controls
60 lines (45 loc) · 1.86 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM ubuntu:latest
MAINTAINER Fillipe Feitosa "fillipefeitosa@gmail.com"
# build arguments
ARG APP_PACKAGES
ARG APP_NAME=urbanus
ARG APP_LOCALE=en_US
ARG APP_CHARSET=UTF-8
ARG APP_USER=meteor
ARG APP_USER_DIR=/home/${APP_USER}
ARG APP_UPLOAD_DIR=/var/www/${APP_NAME}/public
# run environment
ENV APP_PORT=${APP_PORT:-3000}
# exposed ports and volumes
EXPOSE $APP_PORT
# add packages for building NPM modules (required by Meteor)
RUN DEBIAN_FRONTEND=noninteractive apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y curl python build-essential ${APP_PACKAGES}
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y debconf locales
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y git
RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales
RUN DEBIAN_FRONTEND=noninteractive apt-get autoremove
RUN DEBIAN_FRONTEND=noninteractive apt-get clean
# set the locale (required by Meteor)
RUN localedef ${APP_LOCALE}.${APP_CHARSET} -i ${APP_LOCALE} -f ${APP_CHARSET}
# create a non-root user that can write to /usr/local (required by Meteor)
RUN useradd -mUd ${APP_USER_DIR} ${APP_USER}
RUN chown -Rh ${APP_USER} /usr/local
RUN usermod -aG sudo ${APP_USER}
# We create a folder to upload files (ie.: maps, images)
RUN mkdir -p ${APP_UPLOAD_DIR}
RUN chown -Rh ${APP_USER} ${APP_UPLOAD_DIR}
# Change to APP_USER and install Meteor
USER ${APP_USER}
# We create a dedicated folder in which the app will be copied.
RUN cd /home/meteor && mkdir app
# We copy the app in the said folder.
COPY . /home/meteor/app/.
# install Meteor
RUN curl https://install.meteor.com/ | sh
# Optional Env Variables to use cloud database and ngrok
# ENV MONGO_URL mongodb://rally:biblico@ds249128.mlab.com:49128/rallybiblico
# ENV ROOT_URL https://rallybiblico.ngrok.io
# run Meteor from the app directory
CMD cd /home/meteor/app/ && meteor