-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (38 loc) · 1.13 KB
/
Dockerfile
File metadata and controls
52 lines (38 loc) · 1.13 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
#===========
#Build Stage
#===========
FROM bitwalker/alpine-elixir:1.6.6 as build
#Copy the source folder into the Docker image
COPY . .
#Install dependencies and build Release
RUN export MIX_ENV=prod && \
rm -Rf _build && \
mix deps.get && \
mix release
#Extract Release archive to /rel for copying in next stage
RUN APP_NAME="cloudserver" && \
RELEASE_DIR=`ls -d _build/prod/rel/$APP_NAME/releases/*/` && \
mkdir /export && \
tar -xf "$RELEASE_DIR/$APP_NAME.tar.gz" -C /export
#RUN apk --no-cache add elixir
#================
#Deployment Stage
#================
FROM pentacent/alpine-erlang-base:latest
#Set environment variables and expose port
#EXPOSE 4000
#EXPOSE 9001
#EXPOSE 4369
#EXPOSE 80 80
#ENV REPLACE_OS_VARS=true \
# PORT=4000
#ENV REPLACE_OS_VARS=true
#Copy and extract .tar.gz Release file from the previous stage
COPY --from=build /export/ .
#Change user
USER default
#export PUBLIC_HOSTNAME=`curl -s http://169.254.169.254/latest/meta-data/public-hostname`
#Set default entrypoint and command
ENTRYPOINT ["/opt/app/bin/cloudserver"]
CMD ["foreground"]
#CMD ["/webserver/bin/cloudserver", "foreground"]