Skip to content

Commit

Permalink
Merge pull request #66 from baimamboukar/baimamboukar-containerization
Browse files Browse the repository at this point in the history
chore(docker): Dockerize `backend` and update docs to include `how to` run app's docker image
  • Loading branch information
manwar authored Mar 29, 2024
2 parents 422d5b9 + 4de62fa commit ad540fa
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .Dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
api-docs
.github
database
programming_language_extensions.json
AUTHORS
CODE_OF_CONDUCT.md
prototype
18 changes: 15 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Use a slim Perl image to reduce layer size
FROM perl:latest
WORKDIR /srv/TheWeeklyChallenge

# Create a working directory for the application
WORKDIR /app

# Copy the application code from the context
COPY . .
RUN cpanm --installdeps --notest --with-feature=accelerate .

# Install dependencies using cpanm
RUN cpanm --installdeps --notest --with-feature=accelerate
RUN cpanm Dancer2 Plack --force

# Expose the port where the application will listen
EXPOSE 4000
CMD plackup -p 4000 bin/app.psgi

# Start the application using plackup
CMD ["plackup", "-p", "4000", "bin/app.psgi"]
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,27 @@ This project is a fun and welcoming space for developers of all skill levels to
git clone https://github.com/ChallengeForge/TheWeeklyChallenge.git
```

- ## Run the Development Server
- ## Running the Development Server

To ease development processes, we are using `Docker` to effortlessly build and run the backend code for this project. Follow these straightforward steps to start the development server:

1. **Navigate to the root directory of the project**
```bash
$ cd TheWeeklyChallenge
```

2. **Build the Docker image**
```bash
$ docker build -t pwc .
```

3. **Run the Docker image on your local machine**
```bash
$ docker run -t pwc
```

4. **All set**! The development server should now be accessible at [http://127.0.0.1:4000](http://127.0.0.1:4000).


# Contribution

Expand Down

0 comments on commit ad540fa

Please sign in to comment.