forked from localstack/localstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
64 lines (51 loc) · 2.24 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM localstack/java-maven-node-python
MAINTAINER Waldemar Hummer ([email protected])
LABEL authors="Waldemar Hummer ([email protected]), Gianluca Bortoli ([email protected])"
# add files required to run "make install"
ADD Makefile requirements.txt ./
RUN mkdir -p localstack/utils/kinesis/ && mkdir -p localstack/services/ && \
touch localstack/__init__.py localstack/utils/__init__.py localstack/services/__init__.py localstack/utils/kinesis/__init__.py
ADD localstack/constants.py localstack/config.py localstack/
ADD localstack/services/install.py localstack/services/
ADD localstack/utils/common.py localstack/utils/
ADD localstack/utils/kinesis/ localstack/utils/kinesis/
ADD localstack/ext/ localstack/ext/
# install dependencies
RUN make install
# add files required to run "make init"
ADD localstack/package.json localstack/package.json
ADD localstack/services/__init__.py localstack/services/install.py localstack/services/
# initialize installation (downloads remaining dependencies)
RUN make init
# add rest of the code
ADD localstack/ localstack/
ADD bin/localstack bin/localstack
# (re-)install web dashboard dependencies (already installed in base image)
RUN make install-web
# fix some permissions and create local user
RUN mkdir -p /.npm && \
mkdir -p localstack/infra/elasticsearch/data && \
mkdir -p localstack/infra/elasticsearch/logs && \
chmod 777 . && \
chmod 755 /root && \
chmod -R 777 /.npm && \
chmod -R 777 localstack/infra/elasticsearch/config && \
chmod -R 777 localstack/infra/elasticsearch/data && \
chmod -R 777 localstack/infra/elasticsearch/logs && \
chmod -R 777 /tmp/localstack && \
chown -R `id -un`:`id -gn` . && \
adduser -D localstack && \
ln -s `pwd` /tmp/localstack_install_dir
# expose default environment (required for aws-cli to work)
ENV MAVEN_CONFIG=/opt/code/localstack \
USER=localstack \
PYTHONUNBUFFERED=1
# expose service & web dashboard ports
EXPOSE 4567-4583 8080
# install supervisor daemon & copy config file
ADD bin/supervisord.conf /etc/supervisord.conf
# define command at startup
ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
# run tests (to verify the build before pushing the image)
ADD tests/ tests/
RUN make test