-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
71f168d
commit 5273c3f
Showing
7 changed files
with
97 additions
and
64 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
|
||
# | ||
# Getting the various configuration settings from command line / environment variable | ||
# | ||
if [ -z "$MAILGUN_EMAIL_DOMAIN" ]; then | ||
echo "[FATAL ERROR] Missing MAILGUN_EMAIL_DOMAIN (eg: inboxkitten.com)"; | ||
exit 1; | ||
else | ||
echo ">> Detected MAILGUN_EMAIL_DOMAIN env variable : $MAILGUN_EMAIL_DOMAIN"; | ||
fi | ||
|
||
if [ -z "$MAILGUN_API_KEY" ]; then | ||
echo ">> Please type in your MAILGUN_API_KEY"; | ||
read -sp '>> MAILGUN_API_KEY : ' MAILGUN_API_KEY; | ||
echo ""; | ||
else | ||
echo ">> Detected MAILGUN_API_KEY env variable : [intentionally redacted]"; | ||
fi | ||
|
||
if [ -z "$WEBSITE_DOMAIN" ]; then | ||
echo ">> Missing WEBSITE_DOMAIN, using MAILGUN_EMAIL_DOMAIN : $MAILGUN_EMAIL_DOMAIN" | ||
export WEBSITE_DOMAIN="$MAILGUN_EMAIL_DOMAIN" | ||
else | ||
echo ">> Detected WEBSITE_DOMAIN env variable : $WEBSITE_DOMAIN"; | ||
fi | ||
|
||
# | ||
# Applying the configuration | ||
# | ||
echo ">> Applying config settings" | ||
cat "$projectDir/api/config/mailgunConfig.sample.js" | envsubst > "$projectDir/api/config/mailgunConfig.js" | ||
cat "$projectDir/ui/config/apiconfig.sample.js" | envsubst > "$projectDir/ui/config/apiconfig.js" | ||
|
||
# | ||
# Doing the required builds | ||
# |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,69 @@ | ||
FROM node:12-alpine AS ui-build | ||
# | ||
# | ||
# Base alpine image with all the various dependencies | ||
# | ||
# | ||
FROM node:12-alpine AS baseimage | ||
|
||
# Install dependencies | ||
RUN apk add --no-cache gettext | ||
|
||
# # | ||
# # Build the golang imageproxy application | ||
# # | ||
# FROM golang:1.12.6-alpine3.10 AS builder | ||
# Setup the /application/ directory | ||
RUN mkdir -p /application/ | ||
# WORKDIR /application/ | ||
|
||
# # Lets get some useful stiff for building | ||
# RUN apk add --no-cache bash git openssh | ||
# | ||
# | ||
# Initial docker builder (resets node_modules) | ||
# | ||
# | ||
FROM baseimage AS builder | ||
|
||
# # Get the image proxy repo | ||
# RUN go get willnorris.com/go/imageproxy/cmd/imageproxy | ||
# node-gyp installation | ||
RUN apk add --no-cache make gcc g++ python | ||
|
||
# # Double checking that the single binary is installed | ||
# RUN ls -alh /go/bin | ||
# Copy over the requried files | ||
COPY api /application/api/ | ||
COPY ui /application/ui/ | ||
COPY docker-entrypoint.sh /application/docker-entrypoint.sh | ||
|
||
# # | ||
# # Lets build the actual container | ||
# # | ||
# FROM alpine:latest | ||
# Scrub out node_modules | ||
RUN rm -f /application/api/node_modules | ||
RUN rm -f /application/ui/node_modules | ||
|
||
# Lets do the initial npm install | ||
RUN cd /application/ui && ls && npm install --production | ||
RUN cd /application/api && ls && npm install --production | ||
|
||
# # Lets add SSL support | ||
# RUN apk --no-cache add ca-certificates | ||
# | ||
# | ||
# Docker application | ||
# | ||
# | ||
FROM node:12-alpine as application | ||
|
||
# # Copy over built file into bin | ||
# WORKDIR /bin/ | ||
# COPY --from=builder /go/bin/imageproxy . | ||
# Copy over the built files | ||
COPY --from=builder /application /application/ | ||
|
||
# # Set workdir to /tmp/ | ||
# WORKDIR /tmp/ | ||
# Debugging logging | ||
RUN ls /application | ||
|
||
# # Debug checker | ||
# RUN imageproxy --help || true | ||
# Expose the server port | ||
EXPOSE 8000 | ||
|
||
# | ||
# Configurable environment variable | ||
# | ||
ENV MAILGUN_EMAIL_DOMAIN="" | ||
ENV MAILGUN_API_KEY="" | ||
ENV WEBSITE_DOMAIN="" | ||
|
||
# # | ||
# # Preload the NPM installs | ||
# # | ||
# RUN cd /application/ui && ls && npm install | ||
# RUN cd /application/api && ls && npm install | ||
|
||
# # Default entry starts the server at port 80 | ||
# ENTRYPOINT [ "imageproxy" ] | ||
# CMD [ "-addr", "localhost:80" ] | ||
# Setup the entrypoint | ||
ENTRYPOINT [ "/application/docker-entrypoint.sh" ] | ||
CMD [] |