mirror of
https://github.com/zoriya/flood.git
synced 2026-06-01 02:29:01 +00:00
Updated Dockerfile
This does two things: 1. No longer user onbuild. Onbuild is deprecated for [reasons outlined here][reasons]. 2. Build static assets with the container. Before, the static assets wouldn't be built causing the container to crash on start up. [reasons]: https://github.com/docker-library/official-images/issues/2076
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
# Ignore files not needed for building and running to keep image size low.
|
||||
.git/
|
||||
node_modules/
|
||||
|
||||
+25
-2
@@ -1,5 +1,28 @@
|
||||
FROM node:7.8.0-onbuild
|
||||
FROM node:7.8.0
|
||||
|
||||
# Install runtime dependencies and remove state generated by apt-get before
|
||||
# creating intermediate image.
|
||||
RUN apt-get update && apt-get install -y mediainfo && rm -rf /var/lib/apt/lists/*
|
||||
COPY config.docker.js config.js
|
||||
|
||||
# Create app working directory.
|
||||
RUN mkdir -p /usr/src/app
|
||||
WORKDIR /usr/src/app
|
||||
COPY . /usr/src/app
|
||||
|
||||
# Copy docker configuration file. This allows for specifying common configs with
|
||||
# just environment variables.
|
||||
COPY config.docker.js /usr/src/app/config.js
|
||||
|
||||
# Install Dependencies and remove cache to keep image small. This is done in one
|
||||
# step to keep the cache out of intermediate image.
|
||||
RUN npm install && npm cache clean --force
|
||||
|
||||
# Build static assets.
|
||||
RUN npm run build
|
||||
|
||||
# Hints for consumers of the container.
|
||||
EXPOSE 3000
|
||||
VOLUME ["/data"]
|
||||
|
||||
# Start application.
|
||||
CMD [ "npm", "start" ]
|
||||
|
||||
Reference in New Issue
Block a user