service-semaphore/Dockerfile

28 lines
781 B
Text
Raw Normal View History

2023-01-24 12:57:24 +00:00
# Using Alpine to keep the images smaller
# Change to using the official NodeJS Alpine container
2023-07-06 10:25:16 +00:00
FROM node:18-alpine
2023-01-24 12:57:24 +00:00
# Pushing all files into image
2023-07-06 10:25:16 +00:00
ENV SEMAPHORE_VERSION=1.0.0
2023-01-24 12:57:24 +00:00
WORKDIR /app
2023-07-06 10:25:16 +00:00
RUN wget -q "https://github.com/NickColley/semaphore/archive/refs/tags/$SEMAPHORE_VERSION.tar.gz" \
2023-01-24 12:57:24 +00:00
-O /tmp/semaphore.tar.gz \
2023-01-24 13:19:01 +00:00
&& tar xavf /tmp/semaphore.tar.gz --strip-components 1 \
2023-01-24 12:57:24 +00:00
&& rm -f /tmp/semaphore.tar.gz
# Install Semaphore
RUN yarn --production --pure-lockfile \
&& yarn build \
&& yarn cache clean \
&& rm -rf ./src ./docs ./tests ./bin
# Expose port 4002
EXPOSE 4002
2023-01-24 13:59:15 +00:00
ENV PORT=4002
2023-01-24 12:57:24 +00:00
# Setting run-command, using explicit `node` command
# rather than `yarn` or `npm` to use less memory
# https://github.com/nolanlawson/pinafore/issues/971
2023-01-24 13:59:15 +00:00
CMD ["node", "server.js"]
2023-01-24 12:57:24 +00:00